wood burning stoves
The moose likes Swing / AWT / SWT and the fly likes hyperlink in swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "hyperlink in swing" Watch "hyperlink in swing" New topic

hyperlink in swing

Tiju Thomas

Joined: May 25, 2008
Posts: 22
How do we give hyperlinks in swing? Like the in html (anchor tag).

Miklos Szeles
Ranch Hand

Joined: Oct 21, 2008
Posts: 142
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

Joined: Oct 13, 2005
Posts: 44515
Miklos Szeles wrote: . . . This post can be useful.
It is useful, but it has some misprints in: "" or " " when " would be correct.
Brian Cole
Ranch Hand

Joined: Sep 20, 2005
Posts: 877
Consider a JButton with its border turned off.
See http://www.coderanch.com/t/345445/#1516613

bitguru blog
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2383
Use a JEditorPane. It can display HTML with Hyperlinks.
Tiju Thomas

Joined: May 25, 2008
Posts: 22
I actually wanted to open a url in the default browser when I click a JLabel
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10747

Let me see:
Original question posted on 28 Sep 2009
Today: 5 Feb 2010

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link: http://aspose.com/file-tools
subject: hyperlink in swing
jQuery in Action, 3rd edition