I am working on a Swing application in which I have to display HTML files.
I use the JEditorPane control for this. It displays the contents of the HTML file, but not in the same format as the original in the actual HTML file.
JEditorPane does not support the object element. Instead of loading an object file, does it just show ? .
Is there any other built-in control in Swing to view the HTML file, and not JEditorPane ?
I am using the following code:
JEditorPane HtmlPane= new JEditorPane(); File file1= new File("path of the file"); HtmlPane.setContentType("text/html"); HtmlPane.setEditable(false); HtmlPane.setPage(file1.toURI().toURL()); JScrollPane jsp=new JScrollPane(HtmlPane);
adesh source share