Uncaught NullPointer Exception in JEditorPane.setText()
809389Oct 29 2010 — edited Apr 1 2011My app fails in a recent upgrade of Java. I have uploaded to the most recent version 1.6.0_22.
Here is my source code:
JEditorPane textArea = new JEditorPane() ;
textArea.setContentType( "text/html" ) ;
textArea.setMargin( new Insets( 4, 4, 4, 4 ) ) ;
textArea.setText( "Hello World" ) ;
Here's the console output:
java.lang.NullPointerException
at javax.swing.text.html.parser.Parser.errorContext(Unknown Source)
at javax.swing.text.html.parser.Parser.parse(Unknown Source)
at javax.swing.text.html.parser.DocumentParser.parse(Unknown Source)
at javax.swing.text.html.parser.ParserDelegator.parse(Unknown Source)
at javax.swing.text.html.HTMLEditorKit.read(Unknown Source)
at javax.swing.JEditorPane.setText(Unknown Source)
at CTextArea.newTextArea(Contessa.java:1583)
If this is a bug, please let me know how to file a bug report, which I've never done before.
-Jim