I am developing an application which needs a web browser functionality like Mozilla or internet explorer.
I have tried several examples of displaying web pages in jEditorPane but it doesnt seem to work well for me
I am doing my development in netbeans 6.0 here is the code
private void jEdpaneBrowserHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
HyperlinkEvent.EventType type= evt.getEventType();
final URL url = evt.getURL();
if (type == HyperlinkEvent.EventType.ENTERED) {
System.out.println("URL: " + url);
}else if (type == HyperlinkEvent.EventType.ACTIVATED) {
System.out.println("Activated");
EditorKit htmlKit = jEdpaneBrowser.getEditorKitForContentType("text/html");
HTMLDocument doc = (HTMLDocument) htmlKit.createDefaultDocument();
jEdpaneBrowser.setEditorKit(htmlKit);
try {
InputStream in = url.openStream();
//jEdpaneBrowser.setPage(url);
jEdpaneBrowser.read(in, doc);
in.close();
// set the combo
} catch (IOException ioException) {
System.out.println("Error following link" + ioException);
jEdpaneBrowser.setDocument(doc);
}
}
but this code doesnt load pages properly like internet explorer or Mozilla
the pages that dont load are
Google ,
Yahoo! etc
Flash pages are set blank nothing loads..
yahoo recomends me to upgrade the browser i feel jeditorpane cannot render html like InternetExplorer or Mozilla
Please help how can render this html , is there any html renderer which can help me do this .