Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JTable not getting refreshed.

 
Neha D
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.......
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic