wood burning stoves
The moose likes Swing / AWT / SWT and the fly likes Icon in a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Icon in a JTable" Watch "Icon in a JTable" New topic

Icon in a JTable

fahad siddiqui
Ranch Hand

Joined: Jun 14, 2006
Posts: 85
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.

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

Joined: Oct 18, 2000
Posts: 4121

DefaultTableCellRenderer is a JLabel, so all you need to do is extend it to include the image.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

I think you must go through this.


Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
I agree. Here's the link: http://aspose.com/file-tools
subject: Icon in a JTable
jQuery in Action, 3rd edition