• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable Table Cell Renderer Problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I'm new to java and swing and googled coderanch articles helped me a lot. I have a problem right now with a JTable so I thought maybe people with more experience could help. Here it is:

I have a JTable bound to a List of entities read from a database (using JPA). The entity has a foreign key, so it has a sub-List (of another entity) which i use to bind to another JTable (for detail). This works fine if the fields don't require a cell renderer. The detail JTable has a column with byte[] that i should render as the icon but the IconCellRenderer does not work. In fact any cell renderer won't work with the second JTable.

I don't understand. Please help. (By the way, I'm using Netbeans GUI builder but I don't think this is a Netbeans problem. Maybe.)
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think it matters in the least where the data in the JTable came from. However, if your cell renderer "doesn't work" then you're doing something wrong. It's difficult to say more than that, based on the code you have shown us.
 
Pedro Naz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's the main table:

Here's the detail table:


Thanks, Paul.
 
Pedro Naz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's the renderer which of course works (should):
 
It runs on an internal combustion engine. This ad does not:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic