This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
 
Don't get me started about those stupid light bulbs.
 
subject: Image in JTable