File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic
Author

JTable

Lalit Surana
Greenhorn

Joined: Aug 26, 2002
Posts: 3
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

Joined: May 10, 2001
Posts: 3244
Moving this to the Swing forum.


Dave
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

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...


  • -Nate
    Write once, run anywhere, because there's nowhere to hide! - /. A.C.
     
    Consider Paul's rocket mass heater.
     
    subject: JTable