File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoking a browser from an Application with a URL I specify

 
Pranav Jaidka
Ranch Hand
Posts: 264
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic