problem jprogress bar

Started by
1 comment, last by Ronnie Mado Solbakken 11 years, 8 months ago
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);
}

Hello

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.

Follow my hobby projects:

Ognarion Commander (Java/LIBGDX): https://github.com/OlafVanSchlacht/ognarion-commander

Just some general links about Java:

http://www.java-forums.org/forum.php
http://www.oracle.co...view/index.html
http://docs.oracle.c...ase/7/docs/api/

Take your time and got through all of these sources and you'll become a Java God in no-time smile.png

- Awl you're base are belong me! -

- I don't know, I'm just a noob -

This topic is closed to new replies.

Advertisement