private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        if(txtUsuario.getText().isEmpty()){
            JOptionPane.showMessageDialog(rootPane,"Campo Usuário Vazio !");
        }
        else if(pswSenha.getText().isEmpty()){
            JOptionPane.showMessageDialog(rootPane,"Campo Senha Vazio !");
        }else{
            
            LoginDAO login = new LoginDAO();
            try {
                int idUsuario = login.autenticar(txtUsuario.getText(), pswSenha.getText()) ;
                if(idUsuario != 0){
                    frmPrincipal janela = new frmPrincipal(idUsuario);
                    janela.setVisible(true);
                   // JOptionPane.showMessageDialog(rootPane,idUsuario);
                    this.dispose();
            
                }
            } catch (ErroValidacaoException ex) {
                //Logger.getLogger(frmLogin.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(rootPane, ex.getMessage());
            }catch(SQLException ex){
                JOptionPane.showMessageDialog(rootPane, ex.getMessage());
            }
            
            
        
        
        }
    }//GEN-LAST:event_jButton1ActionPerformed