This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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>
It is sorta covered in the JavaRanch Style Guide.
subject: Open a Browser using Java
Similar Threads
How to stop editting the Cell
problem with .jar files deployment
Calling a JSP using Swing
Create a Print Preview using the data set in the rich text editor
commandLink not working in datatable+jsf2.0