JEditorPane throws "java.lang.RuntimeException: Unclosed comment"

[java version "1.6.0_01"

Java(TM) SE Runtime Environment (build 1.6.0_01-b06)

Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)]

Code to generate this problem :

import javax.swing.*;

import java.io.*;

public class TestJEditorPane {

public static void main(String[] args) throws IOException {

JFrame frame = new JFrame("Test JTextPane");

frame.add(new JScrollPane(new JEditorPane("http://greenvolts.blogspot.com/")));

frame.setLocationByPlatform(true);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setSize(500, 500);

frame.setVisible(true);

}

}

Generates this error :

Exception in thread "Thread-1" java.lang.RuntimeException: Unclosed comment

at javax.swing.text.html.CSSParser.readComment(CSSParser.java:726)

at javax.swing.text.html.CSSParser.getIdentifier(CSSParser.java:592)

at javax.swing.text.html.CSSParser.nextToken(CSSParser.java:488)

at javax.swing.text.html.CSSParser.getNextStatement(CSSParser.java:151)

at javax.swing.text.html.CSSParser.parse(CSSParser.java:136)

at javax.swing.text.html.StyleSheet$CssParser.parse(StyleSheet.java:3190)

at javax.swing.text.html.StyleSheet.addRule(StyleSheet.java:289)

at javax.swing.text.html.HTMLDocument$HTMLReader.addCSSRules(HTMLDocument.java:3416)

at javax.swing.text.html.HTMLDocument$HTMLReader$HeadAction.end(HTMLDocument.java:2552)

at javax.swing.text.html.HTMLDocument$HTMLReader.handleEndTag(HTMLDocument.java:2290)

at javax.swing.text.html.parser.DocumentParser.handleEndTag(DocumentParser.java:223)

at javax.swing.text.html.parser.Parser.parse(Parser.java:2233)

at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:105)

at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:73)

at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:230)

at javax.swing.JEditorPane.read(JEditorPane.java:556)

at javax.swing.JEditorPane.read(JEditorPane.java:584)

at javax.swing.JEditorPane$PageLoader.run(JEditorPane.java:647)

Additional info: This problem seems to blogger.com specific .

[2239 byte] By [SenNira] at [2007-11-27 11:47:05]
# 1

I tested your code with the same jdk and it worked fine !!

java_2006a at 2007-7-29 18:11:10 > top of Java-index,Desktop,Core GUI APIs...
# 2

I'm testing (Compile + run) this code in a Linux box ( Fedora core 6 ). Can it make any difference ?

Also do you have any idea about what actually triggering this error in my case ? Any hint from the error message i have attached ?

SenNira at 2007-7-29 18:11:10 > top of Java-index,Desktop,Core GUI APIs...
# 3

I have recently ask one of my friend to test it on window . As he confirmed that this code works fine in window , i asked him to send me the class file.

But when i run that class file , it still gives same error message in Linux .

Is a bug ?

SenNira at 2007-7-29 18:11:10 > top of Java-index,Desktop,Core GUI APIs...