Jprogressbar not updating Sexxxx chat
I have a JProgress Bar that will not update its value while running.
I have the creation of the Progress Bar Dialog it in a separate Thread.
Actually you set the value to zero and therefore JProgress Bar shows zero progress. Suppose i am downloading a file from internet in java and i want to show the progress in a JProgress Bar object named myprogressbar.
If you are setting the value of JProgress Bar from within a loop, It should be done using a separate thread.
Thanks Now I have the following : class Progress Thread implements Runnable In the code where the main GUI thread runs I create and show the Dialog that has the progress bar and then I do: Thread t = new Thread(new Progress Thread()); t.start(); The dialog progress bar still does not display properly.
The dialog It still blank untill the loop has finished.
I'll try it again anyway but at this point I'm starting to wonder if this has a solution.
Actually I ended up refactoring the code and a progress bar (threading) was not needed.
This is a simplified version of my actual loop but this simple version does not work either it only works when I put it in a scaled down simple stand-alone application as I mentioned above.
Also some actual coding examples of the coding suggestions would be greatly appreciated!
CEHJ I guess you mean the Swing Worker code that uses the Property Change Listener on the progress bar?
I actually tried that the other day and maybe I coded it incorrectly but it did not work. Actually that code looks similiar to the code I have now except that the Swing Worker replaces the Thread and you add a Property Change Listerer to the progress bar.