Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

JTable Table Cell Renderer Problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.)
 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Here's the renderer which of course works (should):
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!