*
The moose likes Java in General and the fly likes java open url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java open url" Watch "java open url" New topic
Author

java open url

Shubhanshu Gupta
Greenhorn

Joined: Dec 14, 2011
Posts: 3
how to open a url in java?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
(new java.net.URL(...)).openStream()
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Shubhanshu Gupta wrote:how to open a url in java?


That depends exactly what you mean by that. There are at least two obvious possible interpretations. If you don't TellTheDetails(⇐ click) and ask a clear, precise question, it makes it difficult for people to help you.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19684
    
  20

Jeff is right. Tim's example will open the URL in code only, it won't be made visible. To open a URL visibly you need a completely separate approach (hint: java.awt.Desktop).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java open url