This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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
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.
     
    GeeCON Prague 2014
     
    subject: JTable