• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updation of ProgressBar??

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all friends,
Iam facing problem with updation of progressBar of my swing Interface.I want to update my progressBar by the bytes which is already written by server on destination.It is basically a uploading software.For that iam using a thread and i have written a method of taking the bytes from servlet.And in servlet iam writting bytes by 'PrintWriter' in loop.But I couldn't update progressBar.Can any one plz guide me where i am wrong in my code.If possible plz give me some code for that.Iam pasting those portion of codes only.Eagerly waiting for someone reply.

Regards
Bikash
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that swing components are not thread safe. You should never change the state of a swing component except in the swing dispatcher thread. You can use a javax.swing.Timer to do it like this:

Moving this to the Swing forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic