• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Table Cell Renderer Problem

 
Pedro Naz
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.)
 
Paul Clapham
Sheriff
Posts: 21872
36
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):
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!