Java and the web

How exactly could I make a SWING application view a webpage? Could anyone point me in the direction of a tutorial?

C:\j2sdk1.4.2\demo\jfc\Metalworks\src\MetalworksHelp.java

That’s a good starting point. But keep in mind that it’s a very basic “browser”.

However it’s usually good enough for a help system :slight_smile:


JEditorPane myBrowser = new JEditorPane();

myBrowser.setContentType("text/html");
myBrowser.setPage("http://www.website.com/page.html");

/* add myBrowser to a panel/frame/whatever */

Boom, instant web browser. It will take a little massaging to do exactly what you want, but 99% of the work’s done for you.

Thanks!