File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Open a Browser using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Open a Browser using Java" Watch "Open a Browser using Java" New topic

Open a Browser using Java

shreehari Gopalakrishnan
Ranch Hand

Joined: Jun 01, 2004
Posts: 30
Hi masters

in one my project i have to create an HTMl editor for that i hve to
make a preview button which automatically saves the content of the editor as .htm file and must open automatically in a browser

so while clicking preview button a browser must be opened automatically with the contents of the TextArea

what can we do for that

Please help me

Thanks in advance
Darin Niard
Ranch Hand

Joined: Jun 08, 2004
Posts: 118
Well you do something like this:

Assuming this is on a windows system and you want to use IE, of course
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
The Deitel book "Advanced Java 2 Platform How to Program" includes an example application that displays web pages. The example source code from the book can be downloaded at

Take a look at the WebBrowser example in chapter 2. It does what you're trying to figure out.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Open a Browser using Java
It's not a secret anymore!