File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Repaint help??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Repaint help???" Watch "Repaint help???" New topic

Repaint help???

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
Can anyone tell me how to repaint a component directly, rather than just entering it into the repaint queue.
I want to provide a progress bar for a lengthy operation, but my progress bar doesn't get repainted until the entire operation is complete.
I've tried:
1) Calling the traditional repaint() method on the progress bar and then calling Thread.sleep(10000).
2) calling the components paint() method directly.
Neither seemed to have worked for me. Are there any other options?

Fun programming etcetera!
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Swing is picky about threads and gui updates. Here's apointer into the tutorial page on dealing with progress bars.
I agree. Here's the link:
subject: Repaint help???
It's not a secret anymore!