public NewJDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
jProgressBar1.setVisible(false);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
jButton1.setEnabled(false);
jProgressBar1.setVisible(true);
repaint();
for(int i=0;i<=100;i+=5){
jProgressBar1.setValue(i);
// jProgressBar1.setIndeterminate(false);
try{
jProgressBar1.paintImmediately(0, 0, 100, 100);//0, 1, 100, 10
Thread.sleep(100);
jProgressBar1.setStringPainted(true);
}catch(Exception e){}
}
I use above code for using a Jprogressbar in a JDialog,If I use this I can see a progressbar aftercompleting its process(100 %) and also I want to hide progressbar upto buttonclick.Can any one help me?