• Advertisement
Sign in to follow this  

problem jprogress bar

This topic is 1979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i can´t put my jpogress bar working
when a run the app
this is the code

public void iterate(){
int num=0;
this.jButton31.setVisible(false);
while (num < 9999)
{
try
{
Thread.sleep(100);
}
catch (InterruptedException e)
{

}
num += 100;
pb.setValue(num);

}
this.jButton31.setVisible(true);
}

Share this post


Link to post
Share on other sites
Advertisement
You should read something about how Swing works and the Event Dispatching Queue Thread.
You better take a look at Threading and the SwingWorker class.

In order to make it work you have to open a second thread which updates the Progressbar.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement