Opening an html page from a Java application


I am really stumped. Can anyone tell me how to open a html page from a java application. I already know how to do it from an applet with this getAppletContext().showDocument(url). But I want to do this from a Java application itself. If a user clicks a menu item from an actual application, I want IE to start up and take them to the designated url. I would really appreciate it if someone could help me. Thanks.


  • Since you're running windows, you can do the following trick (we used in some business applications last year). Windows lets you execute programs as well as documents. When a document is executed, the appropriate program (if known) is started. Since the appropriate program is normally IE (or otherwise the user's default browser), when executing an HTML file, IE is started. So use:
    String docname = "";
    Runtime.getRuntime().execute( docname );
    I don't know if I got the funcs right, otherwise check the API.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion