Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

generating hyperlink in table  RSS feed

 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am new to AWT/Swing, I am developing one table with fields InsNumber/pricechart and I am getting InsNumber from xml and Price chart I want to create hyperlink and after clicking that I need to show chart. How can I create this hyperlink in table. Can any one help me.

thanks in advance.
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you can't really add a Hyperlink to a cell because cells are only rendered which means they are not real components.

So, just add a MouseListener to the table and when somebody clicks on the cell you just display a popup chart. You can use a custom renderer with the text underlined to make it look like a hyperlink if you want.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!