Solved

refreshing jPanel at intervals

Posted on 2003-11-03
4
198 Views
Last Modified: 2012-05-04
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
Comment
Question by:kunlenzo247
  • 2
4 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9675243
How r u displaying the data on the panels?
0
 
LVL 15

Accepted Solution

by:
jimmack earned 100 total points
ID: 9675303
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
 

Author Comment

by:kunlenzo247
ID: 9683616
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
 
LVL 15

Expert Comment

by:jimmack
ID: 9684971
No problem ;-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question