• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image in JTable

 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nigel for this example,
i guess i can put any component in the JTable.
Regards, Bili
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic