Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

progress bar and threads

 
tomo black
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic