Hello,
Could someone explain how to make a working progress bar with
JProgressBar?
I can display it with a fixed value on my GUI, but I can't understand
how to get one working. I read the Java documentation for JProgressBar
but it doesn't make it any clearer.
Help!
Gil
Roland - 11 May 2005 22:46 GMT
> Hello,
>
[quoted text clipped - 8 lines]
>
> Gil
See
<http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html>

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
Thomas Weidenfeller - 12 May 2005 08:12 GMT
> Could someone explain how to make a working progress bar with
> JProgressBar?
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
Mikael Flensborg - 12 May 2005 08:21 GMT
> Hello,
>
[quoted text clipped - 8 lines]
>
> Gil
Usuallay a Swing Timer is used to poll the object you want to monitor
the progress on and use this value on the progress bar.
class MyProgressObject {
...
public int getProgress() {
//Calculate some progress value here
...
}
...
}
Timer ProgressUpdater = new Timer(..) {
public void actionPerformed(ActionEvent ..) {
myProgressBar.setValue(myProgressObject.getProgress());
}
}
Make sure you use a Swing Timer, since the actionPerformed body is then
executed in the EDT..
Hope this is useful
/Mikael