Perry Smith

Java Questions & Answers

Archive

Home / Java Q & A Archive Page 5 / Java Q & A Archive / Java Main Page

invoking a browser thry java application
Friday, 04-Jun-1999 07:52:46

203.197.57.46 writes:

How do I lauch a Browser with a specified URL through a Java Application on click of a Button.
I have tried in many ways like :
* Making a applet an application as well as applet.
* creating an instance of applet in a frame , adding it to frame and explicity invoking init amd start.

hema


Responses
Re: invoking a browser thry java application
Saturday, 05-Jun-1999 01:12:00

203.129.225.217 writes:

Did you create a html file for your applet?? Please explain what exactly u are trying to do! U want that ur program itself should launch the browser or what??

Anand Gore


Re: invoking a browser thry java application
Saturday, 05-Jun-1999 02:20:31

152.173.59.48 writes:

Allowing a java app to control another program has to be done through the use of the java.lang.Runtime class.

Use something like

new Process pBrowser = new Runtime.exec("c:\netscape\comm\program\netscape.exe www.yahoo.com");

of course, you have to supply the correct command string to run

MikeD


oops, forgot a part
Saturday, 05-Jun-1999 02:25:51

152.173.59.48 writes:

it's

new Process pBrowser = new Runtime.getRuntime().exec("c:\netscape\comm\program\netscape.exe www.yahoo.com");

MikeD


Home / Java Q & A Archive Page 5 / Java Q & A Archive / Java Main Page