Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Icon in a JTable

 
fahad siddiqui
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display an icon in a cell of a JTable but i also want a "String" to be displayed beside it which would distinguish it as the icons would be the same.

Example:
I will display an image of a key in a table, but each key should display a different thread name beside it.

How is that possible?

Please help. urgently needed.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DefaultTableCellRenderer is a JLabel, so all you need to do is extend it to include the image.

 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you must go through this.

java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTable.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic