aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes progress bar and threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "progress bar and threads" Watch "progress bar and threads" New topic
Author

progress bar and threads

tomo black
Greenhorn

Joined: Mar 01, 2004
Posts: 11
hi, i have a progress bar that shows the completion of a task but it's not running like it should. the bar only moves when the task is completed, not during the task. do i need to implement the bar as a seperate thread or have i messed up in the coding
thanks in advance
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Yes, you need to use another thread to do the processing, and update the progress bar in the event thread. It sounds like you might be trying to update the progress bar inside the thread you are using to do the processing. Here is a link to the section on progress bars in the Swing tutorial.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: progress bar and threads