This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

how to put ImageIcon in JTable

Bo Ling

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

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 !
[ February 25, 2004: Message edited by: Don Kiddick ]
Have you checked out Aspose?
subject: how to put ImageIcon in JTable
jQuery in Action, 3rd edition