This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes Updation of ProgressBar?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Updation of ProgressBar??" Watch "Updation of ProgressBar??" New topic
Author

Updation of ProgressBar??

Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
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

Joined: Jan 30, 2002
Posts: 3451
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.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updation of ProgressBar??