4/30/09

JProgressbar

bar is the object of javax.swing.JProgressbar
---------------------------------------------


bar.setMinimum(0);
bar.setMaximum( int size ); ---------> Your Loop size.
bar.setValue(0);

your loop starts {


bar.setValue(bar.getValue()+1);
bar.setStringPainted(true);

Rectangle progressRect = bar.getBounds();
progressRect.x = 0;
progressRect.y = 0;
bar.paintImmediately( progressRect );


}
your loop ends.

No comments:

Post a Comment