• 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 in JPanel is automatically disabled

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic