アプリケーションに単純なJFormとJDialogがあります。JDialogボックスにはJProgressBar要素が含まれており、JDialogにメソッドを次のように配置します。
public void updateProgress(int val){
prgProgress.setValue(val); //prgProgress-> name of the JProgressBar
}
プログレスバーを更新します。
JFormからJDialogのプログレスバーを更新しようとすると、JProgressBarが期待どおりに更新されません。エラーの原因を教えてください。
元。
public class Status extends javax.swing.JDialog{
private javax.swing.JProgressBar prgProgress = new javax.swing.JProgressBar;
.....
public void updateProgress(int val){
prgProgress.setValue(val); //prgProgress-> name of the JProgressBar
}
.....
}
public class MyForm extends javax.swing.JInternalFrame {
Status s = new Status();
s.setVisible(true);
for(int i=0; i<100; i++){
s.updateProgress(i);
}
}