• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Subclassing HTMLEditorKit

 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
How do I get JEditorPane (and its subclass JTextPane) to use my subclass of javax.swing.text.html.HTMLEditorKit instead of that last class? I need to override the method createDefaultDocument() to do doc.setAsynchronousLoadPriority(-1) instead of ...(4).
Thanks,
Tony
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never done this for replacing the handling of a standard type, but for a non-standard type, you do this:
myJEditorPaneInstance.setEditorKitForContentType("text/foo", myCustomEditorKitInstance);
before setting the content type or loading in a file. I'd try this first and see if it works -- I'd expect it to, but you never know, I guess.
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
Sounds good to me; I'll try it at work on Monday
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked, thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic