Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
Lalit Surana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JTable I am using, does not appear till I resize the frame.
Relevant Points:
1. I am using a TableModel which extends AbstractTableMode to fetch the data for the JTable.
2. The JTable is being added to the JScrollPane. And the JScrollPane is being added on the JPanel.
I have worked on it for a quite a while and cannot figure out why should the JTable be displayed only if the window resizes.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing forum.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the code?

Some things that you may want to look at :
  • Is there any sizing being done on table columns? Maybe there is not initially enough room to display the table?
  • Attach listeners to the table and see when events are being fired. You may be adding data to the table, but the table doesn't know it's data is changed. Resizing forces the table to re-validate itself... you can attach listeners and call validate() when the table gets new data in your code...

  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic