private void jBEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEntrarActionPerformed
     
            String user = jTextLogin.getText().toLowerCase();
            String strpass = jSenha.getText();
            try {
               Class.forName("org.postgresql.Driver");
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(JanelaLogin.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                    Connection con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/bicicletaria", "postgres", "root");
                    Statement st = con.createStatement();
                    String query = "SELECT login, senha FROM usuario WHERE login = '"+user+"' and senha = '"+strpass+"'";
                    ResultSet rs = st.executeQuery(query);
                    if(rs.next()){

                         new JanelaPrincipal().setVisible(true);
                         this.dispose();
                     
                    }
                    else if(user.equals("")||strpass.equals("")){
                        JOptionPane.showMessageDialog(null,"Campo Vazio", "Error",1);
                    }
                    else{
                        JOptionPane.showMessageDialog(null," O Usuário ou a senha informada está incorreta");
                    }
                }catch (SQLException ex) {
                     Logger.getLogger(JanelaLogin.class.getName()).log(Level.SEVERE, null, ex);
                    }
    }//GEN-LAST:event_jBEntrarActionPerformed