File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable" Watch "JTable" New topic


Lalit Surana

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.

Nathan Pruett

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.
    I agree. Here's the link:
    subject: JTable
    It's not a secret anymore!