File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Image in JTable" Watch "Image in JTable" New topic

Image in JTable

omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
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) ?
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
I agree. Here's the link:
subject: Image in JTable
jQuery in Action, 3rd edition