Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hyperlink in swing

 
Tiju Thomas
Greenhorn
Posts: 22
  • 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
  • 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
Posts: 48404
56
  • 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: 902
1
  • 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: 2539
9
  • 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
  • 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: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 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!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic