Skip to main content

Invoking a browser in Java

3 replies [Last post]
iancurrie
Offline
Joined: 2011-02-06
Points: 0

I am a newcomer to Java, self taught using the Java tutorials. The trouble about this is that my teacher is an ignoramus as far as Java is concerned. My immediate problem is how to invoke a browser from my Java application.
Thanks in advance
Ian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tianwang
Offline
Joined: 2008-06-07
Points: 0

Not the prefered way to do it anymore since Java 6.
look at http://download.oracle.com/javase/6/docs/api/java/awt/Desktop.html, method browse()

iancurrie
Offline
Joined: 2011-02-06
Points: 0

Thanks for the tip!
A rather belated message since the E-mail alert sent to me had a screwed-up reply link.
Ian

iancurrie
Offline
Joined: 2011-02-06
Points: 0

It seems that most of replies in this forum are from the questioner; I am no exception.
The answer is to use the Runtime class; I don't think I would ever have guessed the name Runtime, but I should have tried Googling "Java exec" much earlier.
Ian