Professional Documents
Culture Documents
Login
Login
import modelo.Hash;
import javax.swing.JOptionPane;
import modelo.SqlUsuarios;
import modelo.Usuarios;
/**
*
* @author Marko
*/
public class login extends javax.swing.JFrame {
/**
* Creates new form login
*/
public login() {
initComponents();
setLocationRelativeTo(null);
}
/**
* This method is called from within the constructor to
initialize the form.
* WARNING: Do NOT modify this code. The content of this
method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_O
N_CLOSE);
setPreferredSize(new java.awt.Dimension(368, 350));
addWindowListener(new java.awt.event.WindowAdapter() {
public void
windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
});
1
getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
txtUsuario.setFont(new java.awt.Font("Tahoma", 0,
14)); // NOI18N
getContentPane().add(txtUsuario, new
org.netbeans.lib.awtextra.AbsoluteConstraints(150, 10,
150, -1));
txtPassword.setFont(new java.awt.Font("Tahoma", 0,
14)); // NOI18N
getContentPane().add(txtPassword, new
org.netbeans.lib.awtextra.AbsoluteConstraints(150, 50,
150, -1));
2
jLabel3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/fondo0
.jpg"))); // NOI18N
getContentPane().add(jLabel3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(-410, -420, 830,
750));
pack();
}// </editor-fold>//GEN-END:initComponents
private void
btnEntrarActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_btnEntrarActionPerformed
if (!txtUsuario.getText().equals("") && !
pass.equals("")) {
mod.setUsuario(txtUsuario.getText());
mod.setPassword(nuevoPass);
if (modSql.login(mod)) {
Inicio.frmLog = null;
this.dispose();
} else {
JOptionPane.showMessageDialog(null, "Datos
incorrectos");
limpiar();
}
} else {
JOptionPane.showMessageDialog(null, "Debe ingresar
sus datos");
}
}//GEN-LAST:event_btnEntrarActionPerformed
private void
btnsalirActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_btnsalirActionPerformed
Inicio ver=new Inicio();
ver.setVisible(true);
login.super.setVisible(false);
3
}//GEN-LAST:event_btnsalirActionPerformed
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException
ex) {
java.util.logging.Logger.getLogger(login.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>