Sign in to follow this  
Landi20

problem jprogress bar

Recommended Posts

Landi20    257
i can´t put my jpogress bar working
when a run the app
this is the code
[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);
}
[/CODE]

Share this post


Link to post
Share on other sites
munito    1186
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
[b]Just some general links about Java:[/b]

[url="http://www.java-forums.org/forum.php"]http://www.java-forums.org/forum.php[/url]
[url="http://www.oracle.com/us/technologies/java/overview/index.html"]http://www.oracle.co...view/index.html[/url]
[url="http://docs.oracle.com/javase/7/docs/api/"]http://docs.oracle.c...ase/7/docs/api/[/url]

Take your time and got through all of these sources and you'll become a Java God in no-time [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Edited by DrMadolite

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this