private void LogarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LogarActionPerformed
                try {
            Connection con = Conectar.conn();
            
            Cryptography cryptography;
            cryptography = new CryptographySHA512();
            String cript;          
            cript = cryptography.encrypt(Fsenha.getText());
                    
            PreparedStatement login = con.prepareStatement("select * from usuario where email = ? and senha = ?");
            login.setString(1, Femail.getText());
            login.setString(2, cript);

            ResultSet rs = login.executeQuery();

            System.out.println("começo do while");
            if(rs.next()){
                System.out.println("teste 2");
                n = (rs.getString("nome"));
                c = (rs.getString("cpf"));
                e = (rs.getString("email"));
                System.out.println("teste 3 " + n);
                s = (rs.getString("senha"));
                m = (rs.getString("msg"));
                Uaux = new Usuario(n, c, e, s, m);
            }

            
            
            n = null;
            c = null;
            e = null;
            s = null;

            
            if (Uaux != null) {
                System.out.println(Uaux.getNome());
                LabelUser.setText("olá " + Uaux.getNome());
                Plogin.setVisible(false);
                Pmsg.setVisible(true);
                Amsg.setText(m);
            } else {
                JOptionPane.showMessageDialog(rootPane, "Erro");
                LabelUser.setText("faça login ou cadastre-se");
            }
            //System.out.println(Uaux.toString());

            //Uaux = new Usuario(rs.getString("nome"),rs.getString("cpf"),rs.getString("email"),rs.getString("senha"));
            con.close();  // fecha conexão com BD
        } catch (SQLException ex) {
            Logger.getLogger(MultiTab.class.getName()).log(Level.SEVERE, null, ex);
        }
                catch (NoSuchAlgorithmException ex) {
                Logger.getLogger(MultiTab.class.getName()).log(Level.SEVERE, null, ex);
            }

        

    }//GEN-LAST:event_LogarActionPerformed