Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable in JPanel is automatically disabled

 
Akansha Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a swing based application.Here there is JPanel in which there is a JTable , table1 with n rows and 1 column. Each cell of table1 contains another JPanel. The JPanel again contains JTable table2. The problem is after cell rendering the JTables table1 and table2 are visible but are disabled. I mean the scroll doesn't work...the editing functionalituy isn't wroking. Is there any solution to this,?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway you can provide a stripped down version of your code that we can execute and play around with so we can duplicate? Aside from that it sounds like horrible UXP to me. What are you trying to do. Maybe there is a better solution.
 
Brian Cole
Author
Ranch Hand
Posts: 906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Akansha Kumar:
I have a swing based application.Here there is JPanel in which there is a JTable , table1 with n rows and 1 column. Each cell of table1 contains another JPanel.


JTables can't really contain components such as JPanels. They contain values which, when needed, are painted by cell renderers.

At best you can set up cell renderers (and cell editors) to give the illusion that the table cells contain panels. (This is also what's going on when JTable cell appear to contain JComboBoxes or JCheckBoxes.) It sounds like you might be better off not using JTable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic