0
如何在達到100%後將jprogressbar的值設置爲零?將jprogressbar的值設置爲零後達到100%
我用下面的代碼,但並沒有做什麼,我想:
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Thread runner = new Thread(){
@Override
public void run(){
counter = pb_MINIMUM;
while(counter <= pb_MAXIMUM){
Runnable runme = new Runnable(){
public void run(){
jProgressBar1.setValue(counter);
}
};
SwingUtilities.invokeLater(runme);
counter++;
try{
Thread.sleep(100);
}catch(Exception e){
}
}
}
};
runner.start();
if(jProgressBar1.getMaximum()==pb_MAXIMUM){
jProgressBar1.setValue(0);
}
}
感謝所有幫助我能得到這裏...