Possible Duplicate:
display HTML page the same in Java forms
I want to display a HTML file in Java Swing application. I am using the following code, it displays the specified URL web page but I want to display a static HTML page stored on a particular location eg D:\\new folder\test.html
. How is it possible? Is there any other useful tool in Swing than JEditorpane?
I am using the following code
try {
URL url= new URL("http://www.lawcrux.com");
htmlPane = new JEditorPane();
htmlPane.setContentType("text/html");
htmlPane.setPage(url);
htmlPane.addHyperlinkListener(this);
JScrollPane jsp= new JScrollPane(htmlPane);
cp.add(jsp);
jsp.setBounds(750, 50, 600, 600);
} catch(Exception ex) {}