For the problem that Kent Gardner wrote about, where the HTMLEditorKit
throws this kind of exception:
> Exception in thread "Thread-12" java.lang.NullPointerException
> at javax.swing.text.html.parser.Parser.errorContext(Parser.java:736)
> at javax.swing.text.html.parser.Parser.parse(Parser.java:2240)
> at
>javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:105)
> at
>javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:78
>)
> at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:232)
> at javax.swing.JEditorPane.read(JEditorPane.java:555)
> at javax.swing.JEditorPane$PageLoader.run(JEditorPane.java:646)
There's a relatively simple, but non-obvious, workaround that Kent shared
with me. Add this line:
ParserDelegator workaround = new ParserDelegator();
Before creating the JTextPane, JEditorPane, or whatever else it is that
you're gonna hook up to the HTMLEditorKit. Doing this seems to help clean
things up from whatever weird state the previous usage left behind.
-------------
Derek Mooney
Associate Director of Development
Blackboard Collaborate
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden