aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Problem with JTable not getting refreshed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with JTable not getting refreshed." Watch "Problem with JTable not getting refreshed." New topic
Author

Problem with JTable not getting refreshed.

Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hi All,

I have a JTabbedPane with 3 tabs. The first tab has a JScrollPane which further holds a JTable. But sometimes what happens is the JTable doesnt get refreshed & a blank tab is displayed. When I click on the second tab & then come back to the first tab, then I can see the JTable with the data.
So the problem is with the JTable not getting refreshed. Can anyone please explain me as to why this happens and help me out with this problem. I need this urgently.
All help is appreciated.

Thanx.

- Neha....
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
What are you doing when it doesn't get refreshed? You may want to play with
update(Graphics g) repaint() or validate() after whatever method/action is leaving the tab blank.

Its been several years since I've used swing (until the last month) so I don't recall how everything works exactly.


-Tad
Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hi Tad,

Well I am encountering this problem as soon as my applet gets loaded. On clicking on the main tab I see the first tab on it as blank. I also tried using revalidate(), validate() & also repaint() on the tabbed pane & also on the JTable which is placed on a JScrollPane on this tab but it shows me no change. It still remains blank. And this occurs only sometimes.

Can you suggest as what can be done to resolve this issue.

Thanx.

Regards,
- Neha.......
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with JTable not getting refreshed.