• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML creating *functional* links in JTable table cells?

 
Chris Treglio
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using html tags to do some text highlighting in some cells of my JTable. I've noticed that using <a href="whatever">whatever</a> produces text that looks like a hyperlink, but doesn't actually allow the user to click it and launch anything.

Is there a way to get link clicks in GUI components to actually function?
 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JEditorPane has code that can fire HyperlinkEvents when the user clicks on hyperlinks. The other components don't, so you would need detect the mouse clicks yourself.

With JTable you have the added complication that the renderer that painted the contents of the cell probably doesn't exist when the user does his/her clicking.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!