Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Custom Table Cell Renderer with ImageIcon  RSS feed

 
Vivian Aranha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Now when the value is ImageIcon this renderer doesnt work. Please do let me know your thoughts on this or way to work around this problem
 
Brian Cole
Author
Ranch Hand
Posts: 935
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vivian Aranha:
Now when the value is ImageIcon this renderer doesnt work.


I can't say much about "this renderer" since it's not really there, but I feel I should point out that you don't need a custom renderer to show Icons (including ImageIcons) in a JTable.

The functionality is built-in. All you need to do is return Icon.class (or ImageIcon.class, either works) from your table model's getColumnClass() method.
 
Vivian Aranha
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...

i got it working.... The project i am working on is too weird and total confusing to put it down here.... i get stuck and go around them...

I am not a java guy, but asked to work on java for an app... So trying to get this done asap....

Viv
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!