File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes how to put ImageIcon in 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 "how to put ImageIcon in JTable" Watch "how to put ImageIcon in JTable" New topic
Author

how to put ImageIcon in JTable

Bo Ling
Greenhorn

Joined: Oct 27, 2003
Posts: 5
Does the DefaultTableCellRender take care of displaying ImageIcon ? My table model has the getColumnClass defined.

Thanks
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
nope. but it should be fairly easy to enhance DefaultTableCellRenderer to do so.
Create a class ImageIconRenderer (or whatever) that extends DefaultTableCellRenderer.
Override the setValue method to

Register an instance of your new renderer to render ImagIcons using setDefaultRenderer.
that *should* do the trick !
D.
[ February 25, 2004: Message edited by: Don Kiddick ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to put ImageIcon in JTable