Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Java Plug-in 1.6.0_22 bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Plug-in 1.6.0_22 bug?



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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.