File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Invoking a browser from an Application with a URL I specify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Invoking a browser from an Application with a URL I specify" Watch "Invoking a browser from an Application with a URL I specify" New topic
Author

Invoking a browser from an Application with a URL I specify

Pranav Jaidka
Ranch Hand

Joined: Sep 14, 2000
Posts: 264
Hi
I am trying to invoke a browser by clicking a button on my Application .I want the browser to come up with the URL I decide before i click on the button.
To invoke the browser i am using the Runtime class. and then using the Runtime.exec() method .
But thats only half the solution.(Loading a specific URL decided at runtime is a problem)
Is there a way out ??
Thanks
Pranav
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

For starters, check the browser documentation to see how this is done. Runtime.exec() is just taking the string that compromises your request and passing it to the OS, so it's up to the browser to help you from the command line.
Netscape also makes it possible in Unix to issue a call to a running browser with a series of limited commands, but I doubt you want such a specific solution.
Oh, what the heck. If you're on a Unix platform and you want to change the browser window programmatically, try this:
$ netscape -remote openURL("http://www.javaranch.com")
What the heathens do on Windows is anyone's guess.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited October 22, 2001).]


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Invoking a browser from an Application with a URL I specify