I'm writing a Java application with GUI using Swing. One of the GUI components is a JEditorPane that renders HTML. All the rendering is fine except that it shows in the first line the XML header:
?xml version="1.0" encoding="UTF-8" standalone="no"?>
I've googled a little bit and I've found the same question here and there, but never any answer. I know that using some other projects like "Flying saucer" is an option, but before I start adding other libs to my project - is there a way to make it work with Swing?
Two notes:
html = html.replaceFirst("\\<\\?.*\\?\\>", "");
Flying Saucer is a good choice for XHTML. JEditorPane can't even handle self closing tags and there are no other components that come with the standard JDK that you can use.