• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repaint help???

 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing is picky about threads and gui updates. Here's apointer into the tutorial page on dealing with progress bars.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic