the following code , which shows hot use the progressbar in the java swing... it uses the swing worker to animate its progress while installing or doing some updations....
refer this link for further doubts...
swingworker:http://java.sun.com/docs/books/tutorial/uiswing/concurrency/simple.html
/**
this class progress is used to create to update the value by swing worker to the process method.
this class type is mentioned in the swing worker it has two type of parameter, first shows the done method, and it should be overridden. the second parameter specifies the this call, and u should override the process method..
*/
private static class Progress {
private final double barValue;
Progress(double barValue) {
this.barValue = barValue;
}
}
private class processTask extends SwingWorker {
@Override
protected Void doInBackground() throws Exception {
progressBar.setIndeterminate(false);
...