Solved

refreshing jPanel at intervals

Posted on 2003-11-03
4
194 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
Comment Utility
How r u displaying the data on the panels?
0
 
LVL 15

Accepted Solution

by:
jimmack earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
No problem ;-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now