Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java open url

 
Shubhanshu Gupta
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to open a url in java?
 
Tim Moores
Bartender
Posts: 2675
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(new java.net.URL(...)).openStream()
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20492
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic