Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML Link in a JLabel?  RSS feed

 
karl nilsson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to put an html link in the text of a JLabel?
When I try it, the link is blue and underlined, but it won't open the link, or even change color on a mouse click
here's part of the code
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this post to the Swing forum, where I expect it will have better luck...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've not done this, but a quick search seems to indicate the best option
is to use a JEditorPane (dummied up to look like a label)

for sample code - search for HyperlinkListener
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!