This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JProgressBar with a database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JProgressBar with a database connection" Watch "JProgressBar with a database connection" New topic
Author

JProgressBar with a database connection

dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103
Hi,

I have a database. I want to load this data onto my JTable. The problem is it takes several seconds. in this time period I need to show loading message using a JProgressBar.How can i do this? I did try with google. But I didn't find any answer. Please help me.

Thank You.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Use SwingWorker. In short, you start the progress bar (in indeterminate mode, as you don't know how long it will take) , then execute the SwingWorker. In it's done() method (which you override) you stop the progress bar again.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Don't get me started about those stupid light bulbs.
 
subject: JProgressBar with a database connection
 
Similar Threads
Sharing data between web app's
menu creation
share data
designing login page
No proxy with session.load() instead it does a database hit - Why?