• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

refreshing jPanel at intervals

I have an application that retrieves a lot of records from different tables in a database. It then creates different panels as tabs in a JTabbedPane to display the tables.
My problem is, I don't want it to finish pulling all the records before displaying the panels all at once. I want it to display each panel progressively as it populates it with records. I have tried the validate(), revalidate(), repaint() methods and it still won't work. Any help on this?
0
kunlenzo247
Asked:
kunlenzo247
  • 2
1 Solution
 
objectsCommented:
How r u displaying the data on the panels?
0
 
jimmackCommented:
Sounds like you're trying to retrieve the records an update the GUI within the same thread.

Consider moving the database retrievals into a thread on their own (perhaps a SwingWorker), so that the GUI is free to update as you progress.

http://java.sun.com/products/jfc/tsc/articles/threads/update.html
0
 
kunlenzo247Author Commented:
Hi Jimmack, I appreciate your advice. I was able to use the SwingWorker to thread different processes and my appliaction is working fine now. Thanks
0
 
jimmackCommented:
No problem ;-)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now