aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Image in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Image in JTable" Watch "Image in JTable" New topic
Author

Image in JTable

omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
Hi,
as for now i was loading my JTable from a Vector of Strings, can i show an
image in a JTable, can i add a JLabel in it (the JLabel will be containing
the Image) ?
Thanks
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
JTable has a default renderer to display an image, all you need to do is tell the table the type of data for each column and it will choose the appropriate renderer:
omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
Thanks Nigel for this example,
i guess i can put any component in the JTable.
Regards, Bili
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Image in JTable