Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Invoking a URL from Java
sanat
Ranch Hand
Posts: 111
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all,
I need to invoke one URL when my program runs. It should open IE and open the URL in it.
Thanks in advance
Abhinay Verma
Greenhorn
Posts: 24
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try this:
import java.lang.Runtime; public class LaunchBrowser { public static void main(String[] args) { try{ Runtime.getRuntime().exec(new String[]{"cmd.exe", "/c", "start", "http://www.javaranch.com"}); } catch(Exception e){ System.out.println(e.getMessage()); } } }
Hope this helps
[ April 10, 2005: Message edited by: Abhinay Verma ]
sanat
Ranch Hand
Posts: 111
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks a lot Abhinay.
David Harkness
Ranch Hand
Posts: 1646
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You might want to check out the
Java
Desktop Integration project. This is one of the specific features of the library.
And inside of my fortune cookie was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Connection Timed out error
dear all, i created a set of mock exam, please try it.
JBoss beginners guide
Using variables for JavaScript popup window parameters
java open url
More...