progressBar

bem galeria eu ja tentei de tudo
mais nao consigo fazer o progressBar roda
na minha tela de login
ja peguei milhares de exemplos mais ta dificil
ser alguem puder me ajuda agradeço muito
sei que dever ser algum simple que nao notei
vlw

[code]
*/
public class frmLogin extends javax.swing.JDialog {

static final int maximo = 100;
static final int minino = 0;

private final UserDAO dao = new UserDAO();

public frmLogin(java.awt.Frame parent, boolean modal) {
    super(parent, modal);
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (ClassNotFoundException ex) {
        Logger.getLogger(frmLogin.class.getName()).log(Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        Logger.getLogger(frmLogin.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        Logger.getLogger(frmLogin.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(frmLogin.class.getName()).log(Level.SEVERE, null, ex);
    }
    initComponents();
    loadProgressBar();

}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
final frmLogin dialog = new frmLogin(new javax.swing.JFrame(), true);

     if(txlogin.getText().equals("")){
             JOptionPane.showMessageDialog(this,"Campo Login nao poder ser vazio","Campo Login",JOptionPane.ERROR_MESSAGE);
             return;
     }
      if(txpassword.getText().equals("")){
          JOptionPane.showMessageDialog(this,"Campo Senha nao poder ser vazio","Campo Senha",JOptionPane.ERROR_MESSAGE);
        return;    
      } 
      
      try {
        boolean verif = dao.isvalidapassword(txlogin.getText(), txpassword.getText());
        if(!verif){
            JOptionPane.showMessageDialog(this,"Senha ou login invalido","Verifica senha",JOptionPane.ERROR_MESSAGE);
           return;
        }
       for(int i = minino;i < maximo ; i++){
           final int percent = i;
          
          
           try
           {
              dialog.atualizaBarra(percent);
               Thread.sleep(100);}
           catch(InterruptedException e){

           }

       }

        setVisible(false);
        new frmPrincipal().setVisible(true);
      
    } catch (SQLException ex) {
        Logger.getLogger(frmLogin.class.getName()).log(Level.SEVERE, null, ex);
    }
}                                        

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
 setVisible(false);
}                                        

private void jProgressBar1PropertyChange(java.beans.PropertyChangeEvent evt) {                                             
    // TODO add your handling code here:
}                                            

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
         final   frmLogin dialog = new frmLogin(new javax.swing.JFrame(), true);
            dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent e) {
                    System.exit(0);
                }
            });
            dialog.setVisible(true);
        }
    });
}

// Variables declaration - do not modify                     
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JTextField txlogin;
private javax.swing.JPasswordField txpassword;
// End of variables declaration                   

private void loadProgressBar() {
    jProgressBar1 = new JProgressBar();
    jProgressBar1.setMaximum(maximo);
    jProgressBar1.setMinimum(minino);
    jProgressBar1.setBackground(Color.red);
    add(jProgressBar1);
}

public void atualizaBarra(int valor){
    jProgressBar1.setValue(valor);
}

}[/code]

Nossa… posta somente a parte que vc não consegue…he he he…assim fica difícil… ou que vc acha que está dando erro

nao da erro nenhum roda de boa
loga de boa
mais o progressabar em baixo
nao aparecer carregando
so queria fazer uma graça
mais ta dificil

public class ProgressSample { public static void main(String args[]) { JFrame f = new JFrame("JProgressBar Sample"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container content = f.getContentPane(); JProgressBar progressBar = new JProgressBar(); progressBar.setValue(25); progressBar.setStringPainted(true); Border border = BorderFactory.createTitledBorder("Reading..."); progressBar.setBorder(border);
cara ve se resolve!!!

faz assim… Teoricamente…vc tem a tela com o progress… na ação da janela…vc executa em uma nova thread, ou seja em um processo paraleleo…e não na mesma linha de execução . e dentro dessa thread vc vai setando o andamento no progress…daí funciona… eu já fiz isso e funcionou…mas não exatamente para um login he he he

leo desculpa minha ignoracia mais como faz
isso eu entedi a teoria mais nao sei como
fazer na pratica
ser vc puder me da um exemplo agradeço muito
pq ja tentei isso ir nao tive muito exeto
agradeço deste ja