This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with JTable not getting refreshed." Watch "Problem with JTable not getting refreshed." New topic

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.


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

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.


- Neha.......
Have you checked out Aspose?
subject: Problem with JTable not getting refreshed.
It's not a secret anymore!