Solved

refreshing jPanel at intervals

Posted on 2003-11-03
4
197 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 58
hibernate example using maven 12 56
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 30
Bot application - advice 3 37
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

808 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