File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hyperlink in swing

 
Tiju Thomas
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do we give hyperlinks in swing? Like the in html (anchor tag).

 
Miklos Szeles
Ranch Hand
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tiju,

Can you be a little bit more specific? Where do you want to use a hyperlink? Are you talking about a component which displays an underlined blue text and can be clicked? If yes then you have to implement it yourself. This post can be useful.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Miklos Szeles wrote: . . . This post can be useful.
It is useful, but it has some misprints in: "" or " " when " would be correct.
 
Brian Cole
Author
Ranch Hand
Posts: 886
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider a JButton with its border turned off.
See http://www.coderanch.com/t/345445/#1516613
 
Rob Camick
Ranch Hand
Posts: 2473
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a JEditorPane. It can display HTML with Hyperlinks.
 
Tiju Thomas
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually wanted to open a url in the default browser when I click a JLabel
 
Maneesh Godbole
Saloon Keeper
Posts: 10967
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me see:
Original question posted on 28 Sep 2009
Today: 5 Feb 2010
Wow!

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic