From 03040868df095b35bbace13bbc54089e6409766a Mon Sep 17 00:00:00 2001 From: "EduardoUyaguari2@github.com" <> Date: Thu, 23 Sep 2021 19:40:45 -0500 Subject: [PATCH 1/5] Registro de Rutina --- src/controlador/ControlRegistrar_Rutina.java | 102 +++++++++++ src/controlador/Main.java | 7 + src/modelo/conexion/PGConexion.java | 2 +- src/modelo/dao/RutinaDao.java | 67 +++++++ src/modelo/vo/RutinaVo.java | 4 + src/vista/VistaRegistrar_Rutina.form | 137 ++++++++++++++ src/vista/VistaRegistrar_Rutina.java | 178 +++++++++++++++++++ 7 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 src/controlador/ControlRegistrar_Rutina.java create mode 100644 src/modelo/dao/RutinaDao.java create mode 100644 src/vista/VistaRegistrar_Rutina.form create mode 100644 src/vista/VistaRegistrar_Rutina.java diff --git a/src/controlador/ControlRegistrar_Rutina.java b/src/controlador/ControlRegistrar_Rutina.java new file mode 100644 index 0000000..233cdde --- /dev/null +++ b/src/controlador/ControlRegistrar_Rutina.java @@ -0,0 +1,102 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controlador; + +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import modelo.dao.RutinaDao; +import vista.VistaRegistrar_Rutina; + +/** + * + * @author Casa + */ +public class ControlRegistrar_Rutina { + private RutinaDao modelo; + private VistaRegistrar_Rutina vista; + + public ControlRegistrar_Rutina(RutinaDao modelo, VistaRegistrar_Rutina vista){ + this.vista = vista; + this.modelo=modelo; + + vista.setVisible(true); + vista.setTitle("Registro de Rutina - Nexo Gym"); + vista.setResizable(false); + vista.setLocationRelativeTo(null); + vista.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + } + + public void funcionalidad() { + + vista.getBtnRegistrar().addActionListener(l -> registrarRutina()); + + } + + private boolean validacion() { + + String nombre = vista.getTxtNombre().getText(); + String descripcion = vista.getTxtDescripcion().getText(); + boolean validacion = true; + + if (nombre.isEmpty() || descripcion.isEmpty()) { + return false; + + } + return validacion; + } + + private boolean verificarRutina() { + + return modelo.mostrarDatos().stream().noneMatch(c -> c.getNombre().equals(vista.getTxtNombre().getText())); + } + + private void sentenciaInsert() { + + String rutina = vista.getTxtNombre().getText().trim(); + String descripcion = vista.getTxtDescripcion().getText().trim(); + + modelo.setNombre(rutina); + modelo.setDescripcion(descripcion); + + if (modelo.insertar()) { + JOptionPane.showMessageDialog(vista, "Rutina Registrado"); + + } else { + JOptionPane.showMessageDialog(vista, "Error al Guardar"); + } + } + + private void reiniciarCampos() { + + vista.getTxtNombre().setText(""); + vista.getTxtDescripcion().setText(""); + + } + + private void registrarRutina() { + + boolean validacion_campos = validacion(); + + if (validacion_campos) { + + boolean checkrutina = verificarRutina(); + + if (checkrutina) { + + sentenciaInsert(); + reiniciarCampos(); + + } else { + JOptionPane.showMessageDialog(vista, "Rutina ya registrado", "Advertencia", JOptionPane.ERROR_MESSAGE); + vista.getTxtNombre().grabFocus(); + } + + } else { + JOptionPane.showMessageDialog(vista, "Rellenar todos los campos ", "Mensaje", JOptionPane.ERROR_MESSAGE); + } + } +} diff --git a/src/controlador/Main.java b/src/controlador/Main.java index 95a810c..8db7956 100644 --- a/src/controlador/Main.java +++ b/src/controlador/Main.java @@ -1,8 +1,10 @@ package controlador; +import modelo.dao.RutinaDao; import modelo.dao.UsuarioDao; import vista.VistaLogin; +import vista.VistaRegistrar_Rutina; public class Main { @@ -13,6 +15,11 @@ public static void main(String[] args) { ControlLogin login = new ControlLogin(user, vl); login.funcionalidad(); + +// RutinaDao mode =new RutinaDao(); +// VistaRegistrar_Rutina vis = new VistaRegistrar_Rutina(); +// ControlRegistrar_Rutina cont =new ControlRegistrar_Rutina(mode, vis); +// cont.funcionalidad(); } diff --git a/src/modelo/conexion/PGConexion.java b/src/modelo/conexion/PGConexion.java index e0b70c7..d11bbd8 100644 --- a/src/modelo/conexion/PGConexion.java +++ b/src/modelo/conexion/PGConexion.java @@ -18,7 +18,7 @@ public class PGConexion { String CadenaConexion = "jdbc:postgresql://localhost:5432/nexo_gym"; //cadena de conección String usuarioBD = "postgres"; - String contraBD = "tres4";//tres4 + String contraBD = "1234";//tres4 diff --git a/src/modelo/dao/RutinaDao.java b/src/modelo/dao/RutinaDao.java new file mode 100644 index 0000000..8b22ef6 --- /dev/null +++ b/src/modelo/dao/RutinaDao.java @@ -0,0 +1,67 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package modelo.dao; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import modelo.conexion.PGConexion; +import modelo.vo.RutinaVo; + +/** + * + * @author Casa + */ +public class RutinaDao extends RutinaVo { + + private PGConexion conecta = new PGConexion(); + + public RutinaDao() { + } + + public RutinaDao(int id_rutina, String nombre, String descripcion) { + super(id_rutina, nombre, descripcion); + } + + public List mostrarDatos() { + + List lista_rutina = new ArrayList<>(); + String sql = "select * from rutina order by 1"; + ResultSet rs = conecta.consulta(sql); + + try { + + while (rs.next()) { + + RutinaVo c = new RutinaDao(); + + c.setId_rutina(rs.getInt("id_rutina")); + c.setNombre(rs.getString("nombre")); + c.setDescripcion(rs.getString("descripcion")); + + lista_rutina.add(c); + + } + + rs.close();//cerramos conexion base. + return lista_rutina; + } catch (SQLException ex) { + Logger.getLogger(RutinaDao.class.getName()).log(Level.SEVERE, null, ex); + return null; + } + } + + public boolean insertar() { + String sql = "INSERT INTO rutina(\n" + + "nombre, descripcion)\n" + + "VALUES ('" + getNombre() + "','" + getDescripcion()+ "');"; + return conecta.accion(sql); + } + +} diff --git a/src/modelo/vo/RutinaVo.java b/src/modelo/vo/RutinaVo.java index f88a189..c7227e5 100644 --- a/src/modelo/vo/RutinaVo.java +++ b/src/modelo/vo/RutinaVo.java @@ -9,6 +9,10 @@ public class RutinaVo { private String nombre; private String descripcion; + public RutinaVo() { + } + + public RutinaVo(int id_rutina, String nombre, String descripcion) { this.id_rutina = id_rutina; this.nombre = nombre; diff --git a/src/vista/VistaRegistrar_Rutina.form b/src/vista/VistaRegistrar_Rutina.form new file mode 100644 index 0000000..5fcafbf --- /dev/null +++ b/src/vista/VistaRegistrar_Rutina.form @@ -0,0 +1,137 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/vista/VistaRegistrar_Rutina.java b/src/vista/VistaRegistrar_Rutina.java new file mode 100644 index 0000000..45b94bb --- /dev/null +++ b/src/vista/VistaRegistrar_Rutina.java @@ -0,0 +1,178 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package vista; + +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JToggleButton; + +/** + * + * @author Casa + */ +public class VistaRegistrar_Rutina extends javax.swing.JFrame { + + /** + * Creates new form VistaRegistrar_Rutina + */ + public VistaRegistrar_Rutina() { + initComponents(); + } + + public JToggleButton getBtnRegistrar() { + return btnRegistrar; + } + + public void setBtnRegistrar(JToggleButton btnRegistrar) { + this.btnRegistrar = btnRegistrar; + } + + public JTextArea getTxtDescripcion() { + return txtDescripcion; + } + + public void setTxtDescripcion(JTextArea txtDescripcion) { + this.txtDescripcion = txtDescripcion; + } + + public JTextField getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(JTextField txtNombre) { + this.txtNombre = txtNombre; + } + + /** + * 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") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + txtNombre = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtDescripcion = new javax.swing.JTextArea(); + btnRegistrar = new javax.swing.JToggleButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N + jLabel1.setText("Registro de Rutina"); + + jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel2.setText("Nombre:"); + + txtNombre.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + + jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel3.setText("Descripcion:"); + + txtDescripcion.setColumns(20); + txtDescripcion.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txtDescripcion.setLineWrap(true); + txtDescripcion.setRows(5); + txtDescripcion.setWrapStyleWord(true); + jScrollPane1.setViewportView(txtDescripcion); + + btnRegistrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + btnRegistrar.setText("Registrar"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(40, 40, 40) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel3) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jScrollPane1) + .addComponent(txtNombre)) + .addGap(119, 119, 119)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(179, 179, 179) + .addComponent(jLabel1)) + .addGroup(layout.createSequentialGroup() + .addGap(201, 201, 201) + .addComponent(btnRegistrar))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(32, 32, 32) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(25, 25, 25) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addComponent(btnRegistrar) + .addContainerGap(26, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Rutina().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JToggleButton btnRegistrar; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea txtDescripcion; + private javax.swing.JTextField txtNombre; + // End of variables declaration//GEN-END:variables +} From 6516566231bfda7ff5acded09c31472462180302 Mon Sep 17 00:00:00 2001 From: "EduardoUyaguari2@github.com" Date: Thu, 23 Sep 2021 19:48:38 -0500 Subject: [PATCH 2/5] Registro de Rutina --- nbproject/project.properties | 6 +++--- src/controlador/Main.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nbproject/project.properties b/nbproject/project.properties index e4a7876..976b431 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -39,13 +39,13 @@ file.reference.jcalendar-1.4.jar=C:\\Users\\Usuario\\Downloads\\jcalendar-1.4.ja file.reference.jcalendar-1.4.jar=C:\\Users\\Usuario\\Documents\\NetBeansProjects\\ExamenFINAL\\src\\Validaciones\\jcalendar-1.4.jar >>>>>>> 261438f7329b42aa6fee6032ad9269d693ce60b6 file.reference.jcalendar-1.4.jar-1=C:\\Users\\Usuario\\Downloads\\jcalendar-1.4.jar -file.reference.postgresql-9.4.1209.jar=C:\\Users\\Usuario\\Downloads\\postgresql-9.4.1209.jar +file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar=C:\\Users\\Casa\\Downloads\\postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar includes=** jar.compress=false javac.classpath=\ - ${file.reference.postgresql-9.4.1209.jar}:\ <<<<<<< HEAD:\ - ${file.reference.jcalendar-1.4.jar-1} + ${file.reference.jcalendar-1.4.jar-1}:\ + ${file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar} ${file.reference.jcalendar-1.4.jar} ======= ${file.reference.jcalendar-1.4.jar}:\ diff --git a/src/controlador/Main.java b/src/controlador/Main.java index 8db7956..39ca4ac 100644 --- a/src/controlador/Main.java +++ b/src/controlador/Main.java @@ -16,10 +16,10 @@ public static void main(String[] args) { ControlLogin login = new ControlLogin(user, vl); login.funcionalidad(); -// RutinaDao mode =new RutinaDao(); -// VistaRegistrar_Rutina vis = new VistaRegistrar_Rutina(); -// ControlRegistrar_Rutina cont =new ControlRegistrar_Rutina(mode, vis); -// cont.funcionalidad(); + RutinaDao mode =new RutinaDao(); + VistaRegistrar_Rutina vis = new VistaRegistrar_Rutina(); + ControlRegistrar_Rutina cont =new ControlRegistrar_Rutina(mode, vis); + cont.funcionalidad(); } From 18b3812fcd7ecb288c284e02b0d46810a34d7811 Mon Sep 17 00:00:00 2001 From: EduardoUyaguari2 Date: Thu, 23 Sep 2021 19:53:21 -0500 Subject: [PATCH 3/5] Registro de Rutina --- src/controlador/Main.java | 12 ++++++------ src/modelo/dao/RutinaDao.java | 4 ++-- src/vista/VistaRegistrar_Rutina.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/controlador/Main.java b/src/controlador/Main.java index 39ca4ac..9411151 100644 --- a/src/controlador/Main.java +++ b/src/controlador/Main.java @@ -9,12 +9,12 @@ public class Main { public static void main(String[] args) { - - UsuarioDao user = new UsuarioDao(); - VistaLogin vl = new VistaLogin(); - - ControlLogin login = new ControlLogin(user, vl); - login.funcionalidad(); +// +// UsuarioDao user = new UsuarioDao(); +// VistaLogin vl = new VistaLogin(); +// +// ControlLogin login = new ControlLogin(user, vl); +// login.funcionalidad(); RutinaDao mode =new RutinaDao(); VistaRegistrar_Rutina vis = new VistaRegistrar_Rutina(); diff --git a/src/modelo/dao/RutinaDao.java b/src/modelo/dao/RutinaDao.java index 8b22ef6..d3584c4 100644 --- a/src/modelo/dao/RutinaDao.java +++ b/src/modelo/dao/RutinaDao.java @@ -28,7 +28,7 @@ public RutinaDao() { public RutinaDao(int id_rutina, String nombre, String descripcion) { super(id_rutina, nombre, descripcion); } - + public List mostrarDatos() { List lista_rutina = new ArrayList<>(); @@ -60,7 +60,7 @@ public List mostrarDatos() { public boolean insertar() { String sql = "INSERT INTO rutina(\n" + "nombre, descripcion)\n" - + "VALUES ('" + getNombre() + "','" + getDescripcion()+ "');"; + + "VALUES ('" + getNombre() + "','" + getDescripcion() + "');"; return conecta.accion(sql); } diff --git a/src/vista/VistaRegistrar_Rutina.java b/src/vista/VistaRegistrar_Rutina.java index 45b94bb..c2baf7b 100644 --- a/src/vista/VistaRegistrar_Rutina.java +++ b/src/vista/VistaRegistrar_Rutina.java @@ -21,7 +21,7 @@ public class VistaRegistrar_Rutina extends javax.swing.JFrame { public VistaRegistrar_Rutina() { initComponents(); } - + public JToggleButton getBtnRegistrar() { return btnRegistrar; } From d51a55d727b31faffa4f49ff1064f0c1eb838592 Mon Sep 17 00:00:00 2001 From: CristhianEPC Date: Thu, 23 Sep 2021 21:52:47 -0600 Subject: [PATCH 4/5] Mejoramiento de ventana Persona, control y modelo. --- src/controlador/ControlRegistrar_Persona.java | 153 ++++++ src/controlador/Control_Persona.java | 266 --------- src/controlador/Main.java | 10 +- src/modelo/dao/PersonaDao.java | 55 +- src/vista/VistaPersona.form | 486 ---------------- src/vista/VistaPersona.java | 518 ------------------ src/vista/VistaRegistrar_Persona.form | 253 +++++++++ src/vista/VistaRegistrar_Persona.java | 319 +++++++++++ 8 files changed, 734 insertions(+), 1326 deletions(-) create mode 100644 src/controlador/ControlRegistrar_Persona.java delete mode 100644 src/controlador/Control_Persona.java delete mode 100644 src/vista/VistaPersona.form delete mode 100644 src/vista/VistaPersona.java create mode 100644 src/vista/VistaRegistrar_Persona.form create mode 100644 src/vista/VistaRegistrar_Persona.java diff --git a/src/controlador/ControlRegistrar_Persona.java b/src/controlador/ControlRegistrar_Persona.java new file mode 100644 index 0000000..70a8a24 --- /dev/null +++ b/src/controlador/ControlRegistrar_Persona.java @@ -0,0 +1,153 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package controlador; + +import java.sql.Date; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.function.Predicate; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import modelo.dao.PersonaDao; +import modelo.vo.PersonaVo; +import vista.VistaRegistrar_Persona; + +/** + * + * @author Usuario + */ +public class ControlRegistrar_Persona { + + private VistaRegistrar_Persona vista_persona; + private PersonaDao modelo_persona; + + public ControlRegistrar_Persona(PersonaDao modelo_persona, VistaRegistrar_Persona vista) { + this.modelo_persona = modelo_persona; + this.vista_persona = vista; + + vista.setVisible(true); + vista.setTitle("Registro de Persona - Nexo Gym"); + vista.setResizable(false); + vista.setLocationRelativeTo(null); + vista.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + } + + public void funcionalidad() { + + vista_persona.getBtnRegistrar().addActionListener(l -> crearPersona()); + + } + + private boolean buscarPersona(String cedula) { + + boolean busqueda; +// if (!cedula.isEmpty()) { + Predicate cedula_p = p -> p.getDni().equals(cedula); + + busqueda = modelo_persona.mostrarDatos().stream().anyMatch(cedula_p); + + if (busqueda == true) { + JOptionPane.showMessageDialog(vista_persona, "Exite un registro con esta cedula", "Mensaje", JOptionPane.ERROR_MESSAGE); + + } else { + //JOptionPane.showMessageDialog(vista_persona, "Correcto"); + + } + + return busqueda; + + } + + private void crearPersona() { + boolean busqueda = buscarPersona(vista_persona.getTxtDni().getText()); + if (!busqueda) { + List lista = modelo_persona.mostrarDatos(); + + int id = lista.size(); + String dni = vista_persona.getTxtDni().getText(); + String nom = vista_persona.getTxtNombre().getText(); + String ape = vista_persona.getTxtApellido().getText(); + String corre = vista_persona.getTxtCorreo().getText(); + char gene = vista_persona.getCbGenero().getSelectedItem().toString().charAt(0); + String direc = vista_persona.getTxtDireccion().getText(); + String telef = vista_persona.getTxtTeléfono().getText(); + + Instant instant = vista_persona.getDateFecha().getDate().toInstant(); + ZoneId zid = ZoneId.of("America/Guayaquil"); + ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, zid); + Date fecha = Date.valueOf(zdt.toLocalDate()); + + PersonaDao perso = new PersonaDao(); + perso.setId_persona(id+1); + perso.setDni(dni); + perso.setNombre(nom); + perso.setApellido(ape); + perso.setBirthdate(fecha); + perso.setCorreo(corre); + perso.setGenero(gene); + perso.setDireccion(direc); + perso.setTelefono(telef); + + if (perso.grabar()) { + JOptionPane.showMessageDialog(vista_persona, "Persona creada"); + } else { + JOptionPane.showMessageDialog(vista_persona, "error"); + } + + } + } + + // Para despues validar la cedula... y tambien el corre + +// public boolean validadorDeCedula(String cedula) { +// boolean cedulaCorrecta = false; +// +// try { +// +// if (cedula.length() == 10) // ConstantesApp.LongitudCedula +// { +// int tercerDigito = Integer.parseInt(cedula.substring(2, 3)); +// if (tercerDigito < 6) { +//// Coeficientes de validación cédula +//// El decimo digito se lo considera dígito verificador +// int[] coefValCedula = {2, 1, 2, 1, 2, 1, 2, 1, 2}; +// int verificador = Integer.parseInt(cedula.substring(9, 10)); +// int suma = 0; +// int digito = 0; +// for (int i = 0; i < (cedula.length() - 1); i++) { +// digito = Integer.parseInt(cedula.substring(i, i + 1)) * coefValCedula[i]; +// suma += ((digito % 10) + (digito / 10)); +// } +// +// if ((suma % 10 == 0) && (suma % 10 == verificador)) { +// cedulaCorrecta = true; +// } else if ((10 - (suma % 10)) == verificador) { +// cedulaCorrecta = true; +// } else { +// cedulaCorrecta = false; +// } +// } else { +// cedulaCorrecta = false; +// } +// } else { +// cedulaCorrecta = false; +// } +// } catch (NumberFormatException nfe) { +// cedulaCorrecta = false; +// } catch (Exception err) { +// System.out.println("Una excepcion ocurrio en el proceso de validadcion"); +// cedulaCorrecta = false; +// } +// +// if (!cedulaCorrecta) { +// System.out.println("La Cédula ingresada es Incorrecta"); +// } +// return cedulaCorrecta; +// } +} diff --git a/src/controlador/Control_Persona.java b/src/controlador/Control_Persona.java deleted file mode 100644 index aef7f8c..0000000 --- a/src/controlador/Control_Persona.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package controlador; - -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.sql.Date; -import java.time.Instant; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.List; -import javax.swing.JOptionPane; -import javax.swing.table.DefaultTableModel; -import modelo.dao.PersonaDao; -import modelo.vo.PersonaVo; -import vista.VistaPersona; - -/** - * - * @author Usuario - */ -public class Control_Persona { - private VistaPersona vista; - private PersonaDao modelo; - private int seleccion=-1; - - public Control_Persona(VistaPersona vista, PersonaDao modelo) { - this.vista = vista; - this.modelo = modelo; - // mostrar al inicio - vista.setTitle("CRUD PERSONAS"); - vista.getLbMensajes().setText("Bienvienidos Sistema 1.0"); - vista.setVisible(true); - cargaLista(); - } - - public void iniciaControlPersona() { - KeyListener kl = new KeyListener() { - @Override - public void keyTyped(KeyEvent e) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void keyPressed(KeyEvent e) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void keyReleased(KeyEvent e) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - cargaLista(vista.getTxtBusqueda().getText()); - } - }; - MouseListener ml = new MouseListener() { - @Override - public void mouseClicked(MouseEvent me) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void mousePressed(MouseEvent me) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - datosTabla(); - } - - @Override - public void mouseReleased(MouseEvent me) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void mouseEntered(MouseEvent me) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - @Override - public void mouseExited(MouseEvent me) { - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - }; - vista.getBtnActualizar().addActionListener(l -> cargaLista()); - vista.getBtnNuevo().addActionListener(l -> cargarDialogo(1)); - vista.getBtnEditar().addActionListener(l -> cargarDialogo(2)); - vista.getTxtBusqueda().addKeyListener(kl); - vista.getTablaPersona().addMouseListener(ml); - vista.getBtnEliminar().addActionListener(al -> eliminar()); - - } - - private void cargarDialogo(int origen) { - vista.getDlgPersona().setSize(600, 400); - vista.getDlgPersona().setLocationRelativeTo(vista); - if (origen == 1) { - vista.getDlgPersona().setTitle("Crear Persona"); - limpiar(); - vista.getBtnAceptar().addActionListener(al -> crearPersona()); - - } else { - vista.getDlgPersona().setTitle("Editar Persona"); - vista.getBtnAceptar().addActionListener(ml -> modificar()); - } - vista.getDlgPersona().setVisible(true); - - } - - private void cargaLista() { - //Carga datos a la vista. - DefaultTableModel tablaMd; - tablaMd = (DefaultTableModel) vista.getTablaPersona().getModel(); - tablaMd.setNumRows(0); - List lista = modelo.mostrarDatos(); - lista.stream().forEach(per -> { - String[] fila = {per.getId_persona() + "", per.getDni(), per.getNombre(), per.getApellido(), per.getBirthdate() + "", - per.getCorreo(), per.getGenero() + "", per.getDireccion(), per.getTelefono()}; - tablaMd.addRow(fila); - }); - - } - - private void cargaLista(String aguja) { - //Carga datos a la vista. - if (aguja.equals("")) { - cargaLista(); - } else { - DefaultTableModel tablaMd; - tablaMd = (DefaultTableModel) vista.getTablaPersona().getModel(); - tablaMd.setNumRows(0); - List lista = modelo.listarPersonas(aguja); - lista.stream().forEach(per -> { - String[] fila = {per.getId_persona() + "", per.getDni(), per.getNombre(), per.getApellido(), per.getBirthdate() + "", - per.getCorreo(), per.getGenero() + "", per.getDireccion(), per.getTelefono()}; - tablaMd.addRow(fila); - }); - } - - } - - private void crearPersona() { - int id = Integer.parseInt(vista.getTxtId().getText()); - String dni = vista.getTxtDNI().getText(); - String nom = vista.getTxtNombre().getText(); - String ape = vista.getTxtApellido().getText(); - String corre = vista.getTxtCorreo().getText(); - char gene = vista.getCbGenero().getSelectedItem().toString().charAt(0); - String direc = vista.getTxtDireccion().getText(); - String telef = vista.getTxtTelefono().getText(); - - Instant instant = vista.getDtFecha().getDate().toInstant(); - ZoneId zid = ZoneId.of("America/Guayaquil"); - ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, zid); - Date fecha = Date.valueOf(zdt.toLocalDate()); - - PersonaDao perso = new PersonaDao(); - perso.setId_persona(id); - perso.setDni(dni); - perso.setNombre(nom); - perso.setApellido(ape); - perso.setBirthdate(fecha); - perso.setCorreo(corre); - perso.setGenero(gene); - perso.setDireccion(direc); - perso.setTelefono(telef); - - if (perso.grabar()) { - JOptionPane.showMessageDialog(vista, "Persona creada"); - vista.getDlgPersona().setVisible(false); - } else { - JOptionPane.showMessageDialog(vista, "error"); - } - - } - - private void eliminar() { - String ident = vista.getTxtId().getText(); - if (vista.getTxtId().getText() != " ") { - int confirmareliminar = JOptionPane.showConfirmDialog(null, "SEGURO DESEAS ELIMINAR " - + ident, "Confirmacion", JOptionPane.YES_NO_OPTION); - if (confirmareliminar == 0) { - if (modelo.eliminar(ident)) { - JOptionPane.showMessageDialog(null, "eliminado"); - - } else { - JOptionPane.showMessageDialog(null, "error no eliminado"); - } - } - } else { - System.out.println("No ha selecionado un dato"); - - } - - } - - private void modificar() { - int idper = Integer.parseInt(vista.getTxtId().getText()); - int id = Integer.parseInt(vista.getTxtId().getText()); - String dni = vista.getTxtDNI().getText(); - String nom = vista.getTxtNombre().getText(); - String ape = vista.getTxtApellido().getText(); - String corre = vista.getTxtCorreo().getText(); - char gene = vista.getCbGenero().getSelectedItem().toString().charAt(0); - String direc = vista.getTxtDireccion().getText(); - String telef = vista.getTxtTelefono().getText(); - - Instant instant = vista.getDtFecha().getDate().toInstant(); - ZoneId zid = ZoneId.of("America/Guayaquil"); - ZonedDateTime zdt = ZonedDateTime.ofInstant(instant, zid); - Date fecha = Date.valueOf(zdt.toLocalDate()); - - PersonaDao perso = new PersonaDao(); - perso.setNombre(nom); - perso.setApellido(ape); - perso.setBirthdate(fecha); - perso.setCorreo(corre); - perso.setGenero(gene); - perso.setDireccion(direc); - perso.setTelefono(telef); - - if (perso.modificar(id + "")) { - JOptionPane.showMessageDialog(null, "Modificado"); - vista.getDlgPersona().setVisible(false); - - } else { - JOptionPane.showMessageDialog(null, "Error al modificar"); - } - } - - private void datosTabla() { - List ulista = modelo.mostrarDatos(); - seleccion = vista.getTablaPersona().getSelectedRow(); - if (seleccion != -1) { - PersonaVo p = new PersonaVo(); - vista.getTxtDNI().setText(ulista.get(seleccion).getDni()); - vista.getTxtId().setText(ulista.get(seleccion).getId_persona() + ""); - vista.getTxtNombre().setText(ulista.get(seleccion).getNombre()); - vista.getTxtApellido().setText(ulista.get(seleccion).getApellido()); - vista.getTxtTelefono().setText(ulista.get(seleccion).getTelefono()); - vista.getTxtDireccion().setText(ulista.get(seleccion).getDireccion()); - vista.getTxtCorreo().setText(ulista.get(seleccion).getCorreo()); - vista.getCbGenero().setName(ulista.get(seleccion).getGenero() + ""); - vista.getDtFecha().setDate(ulista.get(seleccion).getBirthdate()); - //vista.getDtFecha().setDate(modelo.fech(ulista.get(seleccion).getIdPersona())); - } else { - vista.getTxtId().setText(" "); - } - - } - - private void limpiar() { - vista.getTxtApellido().setText(""); - vista.getTxtId().setText(""); - vista.getTxtCorreo().setText(""); - vista.getTxtDNI().setText(""); - vista.getTxtTelefono().setText(""); - vista.getTxtNombre().setText(""); - vista.getTxtDireccion().setText(""); - // vista.getDtFecha().setDateFormatString("12/09/1999"); - vista.getDlgPersona().setVisible(false); - - } -} diff --git a/src/controlador/Main.java b/src/controlador/Main.java index 95a810c..38fa3c7 100644 --- a/src/controlador/Main.java +++ b/src/controlador/Main.java @@ -8,11 +8,13 @@ public class Main { public static void main(String[] args) { - UsuarioDao user = new UsuarioDao(); - VistaLogin vl = new VistaLogin(); +// UsuarioDao user = new UsuarioDao(); +// VistaLogin vl = new VistaLogin(); +// +// ControlLogin login = new ControlLogin(user, vl); +// login.funcionalidad(); - ControlLogin login = new ControlLogin(user, vl); - login.funcionalidad(); + } diff --git a/src/modelo/dao/PersonaDao.java b/src/modelo/dao/PersonaDao.java index 5000a07..6c00733 100644 --- a/src/modelo/dao/PersonaDao.java +++ b/src/modelo/dao/PersonaDao.java @@ -25,7 +25,7 @@ public PersonaDao(int id_persona, String dni, String nombre, String apellido, Da public List mostrarDatos() { List lista_persona = new ArrayList<>(); - String sql = "select * from persona"; + String sql = "select * from persona order by 1"; ResultSet rs = conecta.consulta(sql); try { @@ -55,37 +55,7 @@ public List mostrarDatos() { } } - public List listarPersonas(String aguja){ - - try { - String sql="select * from persona WHERE "; - sql+=" UPPER(nombre) like UPPER('%"+aguja+"%') OR"; - sql+=" UPPER(apellido) like UPPER('%"+aguja+"%') OR"; - sql+=" id_persona = ("+aguja+") "; - ResultSet rs= conecta.consulta(sql); - List lista=new ArrayList(); - while(rs.next()){ - PersonaVo p= new PersonaVo(); - p.setId_persona(rs.getInt("id_persona")); - p.setDni(rs.getString("dni")); - p.setNombre(rs.getString("nombre")); - p.setApellido(rs.getString("apellido")); - p.setBirthdate(rs.getDate("birthdate")); - p.setCorreo(rs.getString("correo")); - p.setGenero(rs.getString("genero").charAt(0)); - p.setDireccion(rs.getString("direccion")); - p.setTelefono(rs.getString("telefono")); - - lista.add(p); - } - - rs.close(); - return lista; - } catch (SQLException ex) { - Logger.getLogger(PersonaDao.class.getName()).log(Level.SEVERE, null, ex); - return null; - } - } + public boolean grabar(){ String sql; @@ -95,24 +65,5 @@ public boolean grabar(){ } - public boolean eliminar(String indentificar){ - String nsql = "delete from persona where \"idpersona\"='" +indentificar+ "'"; - if(conecta.accion(nsql)){ - - return true; - } - else - { - System.out.println("Error eliminar"); - return false; - } - } - - public boolean modificar(String identificador){ - //System.out.println(getFechaNacimiento()+""); - String nsql = "UPDATE persona set \"nombre\"='"+getNombre()+"',\"apellido\"='"+getApellido()+"',\"birthdate\"='"+getBirthdate()+"',\"correo\"='"+getCorreo()+"',\"genero\"='"+getGenero()+"',\"direccion\"='"+getDireccion()+"',\"telefono\"='"+getTelefono()+"'" - + "WHERE \"id_persona\"='"+identificador+"'"; - return conecta.accion(nsql); - - } + } diff --git a/src/vista/VistaPersona.form b/src/vista/VistaPersona.form deleted file mode 100644 index de45c03..0000000 --- a/src/vista/VistaPersona.form +++ /dev/null @@ -1,486 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - </TableColumnModel> - </Property> - <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> - <TableHeader reorderingAllowed="true" resizingAllowed="true"/> - </Property> - </Properties> - </Component> - </SubComponents> - </Container> - <Container class="javax.swing.JPanel" name="jPanel2"> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> - <Component id="lbMensajes" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace pref="23" max="32767" attributes="0"/> - <Component id="lbMensajes" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="19" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="lbMensajes"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="11" style="2"/> - </Property> - <Property name="text" type="java.lang.String" value="Vista Personas"/> - </Properties> - </Component> - </SubComponents> - </Container> - </SubComponents> -</Form> diff --git a/src/vista/VistaPersona.java b/src/vista/VistaPersona.java deleted file mode 100644 index a11d7f9..0000000 --- a/src/vista/VistaPersona.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package vista; - -import com.toedter.calendar.JDateChooser; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.JTextField; - -/** - * - * @author Usuario - */ -public class VistaPersona extends javax.swing.JFrame { - - /** - * Creates new form VistaPersona - */ - public VistaPersona() { - initComponents(); - } - - public JButton getBtnAceptar() { - return btnAceptar; - } - - public void setBtnAceptar(JButton btnAceptar) { - this.btnAceptar = btnAceptar; - } - - public JButton getBtnActualizar() { - return btnActualizar; - } - - public void setBtnActualizar(JButton btnActualizar) { - this.btnActualizar = btnActualizar; - } - - public JButton getBtnEditar() { - return btnEditar; - } - - public void setBtnEditar(JButton btnEditar) { - this.btnEditar = btnEditar; - } - - public JButton getBtnEliminar() { - return btnEliminar; - } - - public void setBtnEliminar(JButton btnEliminar) { - this.btnEliminar = btnEliminar; - } - - public JButton getBtnImprimir() { - return btnImprimir; - } - - public void setBtnImprimir(JButton btnImprimir) { - this.btnImprimir = btnImprimir; - } - - public JButton getBtnNuevo() { - return btnNuevo; - } - - public void setBtnNuevo(JButton btnNuevo) { - this.btnNuevo = btnNuevo; - } - - public JButton getBtncancelar() { - return btncancelar; - } - - public void setBtncancelar(JButton btncancelar) { - this.btncancelar = btncancelar; - } - - public JComboBox<String> getCbGenero() { - return cbGenero; - } - - public void setCbGenero(JComboBox<String> cbGenero) { - this.cbGenero = cbGenero; - } - - public JDialog getDlgPersona() { - return dlgPersona; - } - - public void setDlgPersona(JDialog dlgPersona) { - this.dlgPersona = dlgPersona; - } - - public JDateChooser getDtFecha() { - return dtFecha; - } - - public void setDtFecha(JDateChooser dtFecha) { - this.dtFecha = dtFecha; - } - - public JLabel getLbMensajes() { - return lbMensajes; - } - - public void setLbMensajes(JLabel lbMensajes) { - this.lbMensajes = lbMensajes; - } - - public JTable getTablaPersona() { - return tablaPersona; - } - - public void setTablaPersona(JTable tablaPersona) { - this.tablaPersona = tablaPersona; - } - - public JTextField getTxtApellido() { - return txtApellido; - } - - public void setTxtApellido(JTextField txtApellido) { - this.txtApellido = txtApellido; - } - - public JTextField getTxtBusqueda() { - return txtBusqueda; - } - - public void setTxtBusqueda(JTextField txtBusqueda) { - this.txtBusqueda = txtBusqueda; - } - - public JTextField getTxtCorreo() { - return txtCorreo; - } - - public void setTxtCorreo(JTextField txtCorreo) { - this.txtCorreo = txtCorreo; - } - - public JTextField getTxtDNI() { - return txtDNI; - } - - public void setTxtDNI(JTextField txtDNI) { - this.txtDNI = txtDNI; - } - - public JTextField getTxtDireccion() { - return txtDireccion; - } - - public void setTxtDireccion(JTextField txtDireccion) { - this.txtDireccion = txtDireccion; - } - - public JTextField getTxtId() { - return txtId; - } - - public void setTxtId(JTextField txtId) { - this.txtId = txtId; - } - - public JTextField getTxtNombre() { - return txtNombre; - } - - public void setTxtNombre(JTextField txtNombre) { - this.txtNombre = txtNombre; - } - - public JTextField getTxtTelefono() { - return txtTelefono; - } - - public void setTxtTelefono(JTextField txtTelefono) { - this.txtTelefono = txtTelefono; - } - - - - /** - * 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() { - - dlgPersona = new javax.swing.JDialog(); - jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - ID = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); - txtId = new javax.swing.JTextField(); - txtDNI = new javax.swing.JTextField(); - txtApellido = new javax.swing.JTextField(); - dtFecha = new com.toedter.calendar.JDateChooser(); - btnAceptar = new javax.swing.JButton(); - btncancelar = new javax.swing.JButton(); - jLabel6 = new javax.swing.JLabel(); - cbGenero = new javax.swing.JComboBox<>(); - jLabel4 = new javax.swing.JLabel(); - txtCorreo = new javax.swing.JTextField(); - jLabel7 = new javax.swing.JLabel(); - txtDireccion = new javax.swing.JTextField(); - jLabel8 = new javax.swing.JLabel(); - txtTelefono = new javax.swing.JTextField(); - jLabel9 = new javax.swing.JLabel(); - jLabel10 = new javax.swing.JLabel(); - txtNombre = new javax.swing.JTextField(); - jPanel1 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - txtBusqueda = new javax.swing.JTextField(); - btnNuevo = new javax.swing.JButton(); - btnEditar = new javax.swing.JButton(); - btnEliminar = new javax.swing.JButton(); - btnActualizar = new javax.swing.JButton(); - btnImprimir = new javax.swing.JButton(); - jScrollPane1 = new javax.swing.JScrollPane(); - tablaPersona = new javax.swing.JTable(); - jPanel2 = new javax.swing.JPanel(); - lbMensajes = new javax.swing.JLabel(); - - jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel2.setText("Nombre:"); - - jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel3.setText("Apellido:"); - - ID.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - ID.setText("ID:"); - - jLabel5.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel5.setText("Fecha de nacimiento:"); - - btnAceptar.setText("Aceptar"); - - btncancelar.setText("Cancelar"); - - jLabel6.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel6.setText("Género:"); - - cbGenero.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Masculino", "Femenino" })); - - jLabel4.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel4.setText("Correo:"); - - jLabel7.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel7.setText("DNI:"); - - jLabel8.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel8.setText("Télefono:"); - - jLabel9.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel9.setText("Registrar Persona"); - - jLabel10.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel10.setText("Dirección:"); - - javax.swing.GroupLayout dlgPersonaLayout = new javax.swing.GroupLayout(dlgPersona.getContentPane()); - dlgPersona.getContentPane().setLayout(dlgPersonaLayout); - dlgPersonaLayout.setHorizontalGroup( - dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(120, 120, 120) - .addComponent(jLabel9)) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(110, 110, 110) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel7) - .addComponent(ID) - .addComponent(jLabel2)) - .addGap(44, 44, 44) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtDNI, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(12, 12, 12) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel4) - .addComponent(jLabel6) - .addComponent(jLabel3) - .addComponent(jLabel5) - .addComponent(jLabel10) - .addComponent(jLabel8)) - .addGap(44, 44, 44) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(dtFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(78, 78, 78) - .addComponent(btnAceptar) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btncancelar))) - .addGap(56, 56, 56)) - ); - dlgPersonaLayout.setVerticalGroup( - dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(20, 20, 20) - .addComponent(jLabel9) - .addGap(10, 10, 10) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(ID)) - .addGap(9, 9, 9) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtDNI, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel7)) - .addGap(10, 10, 10) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) - .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(10, 10, 10) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel3) - .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(10, 10, 10) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel5) - .addComponent(dtFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel6) - .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel4) - .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(10, 10, 10) - .addComponent(jLabel10)) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(11, 11, 11) - .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(dlgPersonaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(11, 11, 11) - .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE) - .addComponent(btncancelar)) - .addGroup(dlgPersonaLayout.createSequentialGroup() - .addGap(9, 9, 9) - .addComponent(jLabel8) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnAceptar))) - .addContainerGap()) - ); - - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - - jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel1.setText("Buscar"); - - txtBusqueda.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - - btnNuevo.setText("Nuevo"); - - btnEditar.setText("Editar"); - - btnEliminar.setText("Eliminar"); - - btnActualizar.setText("Actualizar"); - - btnImprimir.setText("Imprimir"); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txtBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(44, 44, 44) - .addComponent(btnNuevo) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(btnEditar) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnEliminar) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(btnActualizar) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(btnImprimir) - .addContainerGap(98, Short.MAX_VALUE)) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap(43, Short.MAX_VALUE) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(txtBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(btnNuevo) - .addComponent(btnEditar) - .addComponent(btnEliminar) - .addComponent(btnActualizar) - .addComponent(btnImprimir)) - .addGap(29, 29, 29)) - ); - - tablaPersona.setModel(new javax.swing.table.DefaultTableModel( - new Object [][] { - {null, null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null, null} - }, - new String [] { - "ID", "DNI", "Nombre", "Apellido", "Edad", "Correo", "Género", "Teléfono" - } - )); - jScrollPane1.setViewportView(tablaPersona); - - lbMensajes.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N - lbMensajes.setText("Vista Personas"); - - javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); - jPanel2.setLayout(jPanel2Layout); - jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(24, 24, 24) - .addComponent(lbMensajes) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() - .addContainerGap(23, Short.MAX_VALUE) - .addComponent(lbMensajes) - .addGap(19, 19, 19)) - ); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jScrollPane1) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - /** - * @param args the command line arguments - */ - - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel ID; - private javax.swing.JButton btnAceptar; - private javax.swing.JButton btnActualizar; - private javax.swing.JButton btnEditar; - private javax.swing.JButton btnEliminar; - private javax.swing.JButton btnImprimir; - private javax.swing.JButton btnNuevo; - private javax.swing.JButton btncancelar; - private javax.swing.JComboBox<String> cbGenero; - private javax.swing.JDialog dlgPersona; - private com.toedter.calendar.JDateChooser dtFecha; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel10; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JLabel jLabel8; - private javax.swing.JLabel jLabel9; - private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JLabel lbMensajes; - private javax.swing.JTable tablaPersona; - private javax.swing.JTextField txtApellido; - private javax.swing.JTextField txtBusqueda; - private javax.swing.JTextField txtCorreo; - private javax.swing.JTextField txtDNI; - private javax.swing.JTextField txtDireccion; - private javax.swing.JTextField txtId; - private javax.swing.JTextField txtNombre; - private javax.swing.JTextField txtTelefono; - // End of variables declaration//GEN-END:variables -} diff --git a/src/vista/VistaRegistrar_Persona.form b/src/vista/VistaRegistrar_Persona.form new file mode 100644 index 0000000..5e2140a --- /dev/null +++ b/src/vista/VistaRegistrar_Persona.form @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="88" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="txtNombre" min="-2" pref="130" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="txtDni" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtDireccion" min="-2" pref="130" max="-2" attributes="0"/> + <Component id="txtCorreo" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="DateFecha" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="228" max="-2" attributes="0"/> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="399" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtTeléfono" min="-2" pref="130" max="-2" attributes="0"/> + <Component id="txtApellido" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="69" max="-2" attributes="0"/> + <Component id="cbGenero" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="87" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="DateFecha" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="txtDni" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtNombre" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtApellido" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtTeléfono" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtCorreo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtDireccion" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="cbGenero" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="30" max="32767" attributes="0"/> + <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Registro Persona"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNombre"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Nombre"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCorreo"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Correo"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDni"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Cédula"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtApellido"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Apellido"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTeléfono"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Teléfono"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDireccion"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Dirección"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Fecha de Nacimiento"/> + </Properties> + </Component> + <Component class="com.toedter.calendar.JDateChooser" name="DateFecha"> + </Component> + <Component class="javax.swing.JComboBox" name="cbGenero"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="2"> + <StringItem index="0" value="M"/> + <StringItem index="1" value="F"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Género"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnRegistrar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Registrar Persona"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/src/vista/VistaRegistrar_Persona.java b/src/vista/VistaRegistrar_Persona.java new file mode 100644 index 0000000..d02712b --- /dev/null +++ b/src/vista/VistaRegistrar_Persona.java @@ -0,0 +1,319 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package vista; + +import com.toedter.calendar.JDateChooser; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.JTextField; + +/** + * + * @author Usuario + */ +public class VistaRegistrar_Persona extends javax.swing.JFrame { + + /** + * Creates new form VistaPersona + */ + public VistaRegistrar_Persona() { + initComponents(); + } + + public JDateChooser getDateFecha() { + return DateFecha; + } + + public void setDateFecha(JDateChooser DateFecha) { + this.DateFecha = DateFecha; + } + + public JButton getBtnRegistrar() { + return btnRegistrar; + } + + public void setBtnRegistrar(JButton btnRegistrar) { + this.btnRegistrar = btnRegistrar; + } + + public JTextField getTxtApellido() { + return txtApellido; + } + + public void setTxtApellido(JTextField txtApellido) { + this.txtApellido = txtApellido; + } + + public JTextField getTxtCorreo() { + return txtCorreo; + } + + public void setTxtCorreo(JTextField txtCorreo) { + this.txtCorreo = txtCorreo; + } + + public JTextField getTxtDireccion() { + return txtDireccion; + } + + public void setTxtDireccion(JTextField txtDireccion) { + this.txtDireccion = txtDireccion; + } + + public JTextField getTxtDni() { + return txtDni; + } + + public void setTxtDni(JTextField txtDni) { + this.txtDni = txtDni; + } + + public JTextField getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(JTextField txtNombre) { + this.txtNombre = txtNombre; + } + + public JTextField getTxtTeléfono() { + return txtTeléfono; + } + + public void setTxtTeléfono(JTextField txtTeléfono) { + this.txtTeléfono = txtTeléfono; + } + + public JComboBox<String> getCbGenero() { + return cbGenero; + } + + public void setCbGenero(JComboBox<String> cbGenero) { + this.cbGenero = cbGenero; + } + + + + + /** + * 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() { + + jLabel11 = new javax.swing.JLabel(); + txtNombre = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + txtCorreo = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + txtDni = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + txtApellido = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + txtTeléfono = new javax.swing.JTextField(); + jLabel6 = new javax.swing.JLabel(); + txtDireccion = new javax.swing.JTextField(); + jLabel7 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + DateFecha = new com.toedter.calendar.JDateChooser(); + cbGenero = new javax.swing.JComboBox<>(); + jLabel9 = new javax.swing.JLabel(); + btnRegistrar = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + jLabel11.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel11.setText("Registro Persona"); + + jLabel2.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel2.setText("Nombre"); + + jLabel3.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel3.setText("Correo"); + + jLabel4.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel4.setText("Cédula"); + + jLabel5.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel5.setText("Apellido"); + + jLabel6.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel6.setText("Teléfono"); + + jLabel7.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel7.setText("Dirección"); + + jLabel8.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel8.setText("Fecha de Nacimiento"); + + cbGenero.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "M", "F" })); + + jLabel9.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel9.setText("Género"); + + btnRegistrar.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + btnRegistrar.setText("Registrar Persona"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnRegistrar) + .addGap(88, 88, 88)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel4) + .addGap(73, 73, 73) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(66, 66, 66) + .addComponent(jLabel5)) + .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(66, 66, 66) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel8) + .addGap(18, 18, 18) + .addComponent(DateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE)))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(228, 228, 228) + .addComponent(jLabel11)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel7)) + .addGap(399, 399, 399) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtTeléfono, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel9) + .addGap(69, 69, 69) + .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(87, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(35, 35, 35) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(DateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel11) + .addGap(79, 79, 79) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtTeléfono, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3) + .addComponent(jLabel6))) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(jLabel8)))) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel9)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE) + .addComponent(btnRegistrar) + .addGap(20, 20, 20)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Persona().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private com.toedter.calendar.JDateChooser DateFecha; + private javax.swing.JButton btnRegistrar; + private javax.swing.JComboBox<String> cbGenero; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JTextField txtApellido; + private javax.swing.JTextField txtCorreo; + private javax.swing.JTextField txtDireccion; + private javax.swing.JTextField txtDni; + private javax.swing.JTextField txtNombre; + private javax.swing.JTextField txtTeléfono; + // End of variables declaration//GEN-END:variables +} From cf0f219a2c0409c6b7d7479172b5c8faa5898b35 Mon Sep 17 00:00:00 2001 From: Alex <90578081+Alrovil@users.noreply.github.com> Date: Mon, 27 Sep 2021 10:05:23 -0500 Subject: [PATCH 5/5] CambiosRegistroEmpleados --- nbproject/project.properties | 233 +++---- .../ControlRegistrar_Empleado.java | 127 ++++ src/controlador/Main.java | 61 +- src/modelo/conexion/PGConexion.java | 142 ++-- src/modelo/dao/EmpleadoDao.java | 63 ++ src/modelo/vo/EmpleadoVo.java | 135 ++-- src/vista/VistaRegistrar_Empleado.form | 202 ++++++ src/vista/VistaRegistrar_Empleado.java | 301 +++++++++ src/vista/VistaRegistrar_Membresia.java | 394 +++++------ src/vista/VistaRegistrar_Persona.form | 506 +++++++------- src/vista/VistaRegistrar_Persona.java | 638 +++++++++--------- src/vista/VistaRegistrar_Rutina.form | 274 ++++---- src/vista/VistaRegistrar_Rutina.java | 356 +++++----- src/vista/VistaRegistrar_Usuario.form | 544 +++++++-------- src/vista/VistaRegistrar_Usuario.java | 554 +++++++-------- 15 files changed, 2619 insertions(+), 1911 deletions(-) create mode 100644 src/controlador/ControlRegistrar_Empleado.java create mode 100644 src/modelo/dao/EmpleadoDao.java create mode 100644 src/vista/VistaRegistrar_Empleado.form create mode 100644 src/vista/VistaRegistrar_Empleado.java diff --git a/nbproject/project.properties b/nbproject/project.properties index 15d5a0c..582df92 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,114 +1,119 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processor.options= -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.modulepath=\ - ${run.modulepath} -debug.test.classpath=\ - ${run.test.classpath} -debug.test.modulepath=\ - ${run.test.modulepath} -# Files in build.classes.dir which should be excluded from distribution jar -dist.archive.excludes= -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/Nexo_gym.jar -dist.javadoc.dir=${dist.dir}/javadoc -dist.jlink.dir=${dist.dir}/jlink -dist.jlink.output=${dist.jlink.dir}/Nexo_gym -excludes= -<<<<<<< HEAD -file.reference.jcalendar-1.4.jar=C:\\Users\\Usuario\\Downloads\\jcalendar-1.4.jar -======= -file.reference.jcalendar-1.4.jar=C:\\Users\\Usuario\\Documents\\NetBeansProjects\\ExamenFINAL\\src\\Validaciones\\jcalendar-1.4.jar ->>>>>>> 261438f7329b42aa6fee6032ad9269d693ce60b6 -file.reference.jcalendar-1.4.jar-1=C:\\Users\\Usuario\\Downloads\\jcalendar-1.4.jar -file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar=C:\\Users\\Casa\\Downloads\\postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar -file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar-1=C:\\Users\\Usuario\\Documents\\TERCER CICLO\\Programa Visual\\Nueva carpeta\\postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar -file.reference.postgresql-9.4.1209.jar=C:\\Users\\Usuario\\Documents\\NetBeansProjects\\ExamenFINAL\\src\\Validaciones\\postgresql-9.4.1209.jar -includes=** -jar.compress=false -javac.classpath=\ - <<<<<<< HEAD:\ - ${file.reference.jcalendar-1.4.jar-1}:\ - ${file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar}:\ - ${file.reference.postgresql-9.4.1209.jar}:\ - ${file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar-1} - ${file.reference.jcalendar-1.4.jar} -======= - ${file.reference.jcalendar-1.4.jar}:\ - ${libs.absolutelayout.classpath} ->>>>>>> 261438f7329b42aa6fee6032ad9269d693ce60b6 -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.external.vm=true -javac.modulepath= -javac.processormodulepath= -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.modulepath=\ - ${javac.modulepath} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding=${source.encoding} -javadoc.html5=false -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -# The jlink additional root modules to resolve -jlink.additionalmodules= -# The jlink additional command line parameters -jlink.additionalparam= -jlink.launcher=true -jlink.launcher.name=Nexo_gym -main.class=controlador.Main -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project. -# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. -# To set system properties for unit tests define test-sys-prop.name=value: -run.jvmargs= -run.modulepath=\ - ${javac.modulepath} -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -run.test.modulepath=\ - ${javac.test.modulepath} -source.encoding=UTF-8 -src.dir=src -test.src.dir=test +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Nexo_gym.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/Nexo_gym +excludes= +<<<<<<< HEAD +file.reference.jcalendar-1.4.jar=C:\\Users\\Usuario\\Downloads\\jcalendar-1.4.jar +======= +file.reference.jcalendar-1.4.jar=C:\\Users\\Usuario\\Documents\\NetBeansProjects\\ExamenFINAL\\src\\Validaciones\\jcalendar-1.4.jar +>>>>>>> 261438f7329b42aa6fee6032ad9269d693ce60b6 +file.reference.jcalendar-1.4.jar-1=C:\\Users\\Usuario\\Downloads\\jcalendar-1.4.jar +file.reference.jcalendar-1.4.jar-2=C:\\Users\\DELL\\Downloads\\jcalendar-1.4.jar +file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar=C:\\Users\\Casa\\Downloads\\postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar +file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar-1=C:\\Users\\Usuario\\Documents\\TERCER CICLO\\Programa Visual\\Nueva carpeta\\postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar +file.reference.postgresql-9.4.1209.jar=C:\\Users\\Usuario\\Documents\\NetBeansProjects\\ExamenFINAL\\src\\Validaciones\\postgresql-9.4.1209.jar +file.reference.postgresql-9.4.1212.jar=C:\\Users\\DELL\\Downloads\\postgresql-9.4.1212.jar +includes=** +jar.compress=false +javac.classpath=\ + <<<<<<< HEAD:\ + ${file.reference.jcalendar-1.4.jar-1}:\ + ${file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar}:\ + ${file.reference.postgresql-9.4.1209.jar}:\ + ${file.reference.postgresql-42.2.5_26bc31adb6d0bfe2e78687d1ad5afae3.jar-1}:\ + ${file.reference.jcalendar-1.4.jar-2}:\ + ${file.reference.postgresql-9.4.1212.jar}:\ + ${libs.absolutelayout.classpath} + ${file.reference.jcalendar-1.4.jar} +======= + ${file.reference.jcalendar-1.4.jar}:\ + ${libs.absolutelayout.classpath} +>>>>>>> 261438f7329b42aa6fee6032ad9269d693ce60b6 +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=Nexo_gym +main.class=controlador.Main +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/src/controlador/ControlRegistrar_Empleado.java b/src/controlador/ControlRegistrar_Empleado.java new file mode 100644 index 0000000..7fb4f7e --- /dev/null +++ b/src/controlador/ControlRegistrar_Empleado.java @@ -0,0 +1,127 @@ + +package controlador; + +import java.awt.Color; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.sql.Date; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.function.Predicate; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.border.LineBorder; +import modelo.dao.CargoDao; +import modelo.dao.EmpleadoDao; +import modelo.dao.PersonaDao; +import modelo.vo.EmpleadoVo; +import modelo.vo.PersonaVo; +import vista.VistaRegistrar_Empleado; + +/** + * + * @author Alex + */ + +public class ControlRegistrar_Empleado { + private EmpleadoDao modelo; + private VistaRegistrar_Empleado vista; + private PersonaDao modelo_persona = new PersonaDao(); + private CargoDao modelo_cargo = new CargoDao(); + public ControlRegistrar_Empleado(EmpleadoDao modelo, VistaRegistrar_Empleado vista) { + this.modelo = modelo; + this.vista = vista; + vista.setVisible(true); + vista.setTitle("Registro de Empleados - Nexo Gym"); + vista.setResizable(false); + vista.setLocationRelativeTo(null); + vista.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + //buscarPersona(vista.getTxtCedula().getText()); + //verificarCargo(); + cargarCargo(); + + } + + public void funcionalidad(){ + + vista.getBtnRegistrarE().addActionListener(l->crearEmpleado()); + + } + + private boolean verificarPersona(String cedula) { + boolean busqueda; + Predicate<PersonaVo> cedula_p = p -> p.getDni().equals(cedula); + busqueda = modelo_persona.mostrarDatos().stream().anyMatch(cedula_p); + if (busqueda == true) { + System.out.println("Cedula Correcta"); + vista.getTxtCedula().setBorder(new LineBorder(Color.decode("#6CC01B"), 2)); + modelo_persona.mostrarDatos().stream().filter(cedula_p).forEach((t) -> { + vista.getTxtPersona().setText(t.getNombre() + " " + t.getApellido()); + + }); + } else { + System.out.println("Cedula Incorrecta"); + vista.getTxtCedula().setBorder(new LineBorder(Color.decode("#C33529"), 2)); + vista.getTxtCedula().setText(""); + } + return busqueda; + } + + + private void cargarCargo() { + modelo_cargo.mostrarDatos().stream().forEach((m) -> { + vista.getCb_cargo().addItem(m.getNombre()); + //vista.getCb_cargo().addItem(m.getId_cargo()+""); + }); + + } + + private int VerificarCedula( String cedula){ + int id_persona=modelo_persona.mostrarDatos().stream().filter(persona ->persona.getDni().equals(cedula)).findAny().get().getId_persona(); + return id_persona; + } + + private void crearEmpleado() { + + boolean busqueda = verificarPersona(vista.getTxtCedula().getText()); + if (busqueda) { + + List<EmpleadoVo> lista = modelo.mostrarDatos(); + + int idpersona=VerificarCedula(vista.getTxtCedula().getText()); + int id_cargo=modelo_cargo.mostrarDatos().get(vista.getCb_cargo().getSelectedIndex()).getId_cargo(); + Instant instant= vista.getFechaContrato().getDate().toInstant(); + ZoneId zid= ZoneId.of("America/Guayaquil"); + ZonedDateTime zdt=ZonedDateTime.ofInstant(instant, zid); + Date fecha = Date.valueOf(zdt.toLocalDate()); + System.out.println("fecha"+ fecha); + Double sueldo = Double.valueOf(vista.getTxtSueldo().getText()); + System.out.println("Sueldo"+ sueldo); + + + + try { + EmpleadoDao emp = new EmpleadoDao(); + emp.setId_persona(idpersona); + emp.setId_cargo(id_cargo); + emp.setFecha_contrato(fecha); + emp.setSueldo(sueldo); + + if (emp.grabar()) { + System.out.println("graba"); + JOptionPane.showMessageDialog(vista, "Empleado creado"); + } else { + JOptionPane.showMessageDialog(vista, "error"); + } + } catch ( NumberFormatException ex ) { + System.out.println("Datos Vacios "+ ex); + + } + }else{ + System.out.println("Persona no esta registrada"); + } + } + +} diff --git a/src/controlador/Main.java b/src/controlador/Main.java index f73b106..fbce318 100644 --- a/src/controlador/Main.java +++ b/src/controlador/Main.java @@ -1,27 +1,34 @@ -package controlador; - - -import modelo.dao.PersonaDao; -import modelo.dao.RutinaDao; -import modelo.dao.UsuarioDao; -import vista.VistaLogin; -import vista.VistaRegistrar_Persona; -import vista.VistaRegistrar_Rutina; - -public class Main { - - public static void main(String[] args) { -// -// UsuarioDao user = new UsuarioDao(); -// VistaLogin vl = new VistaLogin(); -// -// ControlLogin login = new ControlLogin(user, vl); -// login.funcionalidad(); - PersonaDao mode =new PersonaDao(); - VistaRegistrar_Persona vis = new VistaRegistrar_Persona(); - ControlRegistrar_Persona cont =new ControlRegistrar_Persona(mode, vis); - cont.funcionalidad(); - - } - -} +package controlador; + + +import modelo.dao.EmpleadoDao; +import modelo.dao.PersonaDao; +import modelo.dao.RutinaDao; +import modelo.dao.UsuarioDao; +import vista.VistaLogin; +import vista.VistaRegistrar_Empleado; +import vista.VistaRegistrar_Persona; +import vista.VistaRegistrar_Rutina; + +public class Main { + + public static void main(String[] args) { +// +// UsuarioDao user = new UsuarioDao(); +// VistaLogin vl = new VistaLogin(); +// +// ControlLogin login = new ControlLogin(user, vl); +// login.funcionalidad(); + PersonaDao mode =new PersonaDao(); + VistaRegistrar_Persona vis = new VistaRegistrar_Persona(); + ControlRegistrar_Persona cont =new ControlRegistrar_Persona(mode, vis); + cont.funcionalidad(); + +// EmpleadoDao mode =new EmpleadoDao(); +// VistaRegistrar_Empleado vis = new VistaRegistrar_Empleado(); +// ControlRegistrar_Empleado cont =new ControlRegistrar_Empleado(mode, vis); +// cont.funcionalidad(); + + } + +} diff --git a/src/modelo/conexion/PGConexion.java b/src/modelo/conexion/PGConexion.java index b604d80..e20d429 100644 --- a/src/modelo/conexion/PGConexion.java +++ b/src/modelo/conexion/PGConexion.java @@ -1,71 +1,71 @@ -package modelo.conexion; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class PGConexion { - - /* conexion a la base de datos Postgresql*/ - - Connection con; //conexion - Statement st;//comandos sql - ResultSet rs;//resultados de consulta. - - String CadenaConexion = "jdbc:postgresql://localhost:5432/nexo_gym"; //cadena de conección - String usuarioBD = "postgres"; - String contraBD = "pallmay1234";//tres4 - - - - public PGConexion() { - - try { - Class.forName("org.postgresql.Driver");//paquete jar que importamos para postgresql - } catch (ClassNotFoundException ex) { - Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); - } - - try { - con = DriverManager.getConnection(CadenaConexion, usuarioBD, contraBD);//conexion a la base - } catch (SQLException ex) { - Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); - } - - } - - public ResultSet consulta(String sqlc) { - - try { - - st = con.createStatement();//crear sentencia - rs = st.executeQuery(sqlc);//resultado de la consulta - return rs; - - } catch (SQLException ex) { - Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); - return null; - } - } - - public boolean accion(String sqla) { - - try { - - st = con.createStatement();//crear sentencia - boolean rb = st.execute(sqla); //metodo devuelve un booleano de acuerdo a la ejecucion de la consulta - st.close(); //cerramos la conexion - return true;//rb; - - } catch (SQLException ex) { - Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); - return false; - } - - } - -} +package modelo.conexion; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class PGConexion { + + /* conexion a la base de datos Postgresql*/ + + Connection con; //conexion + Statement st;//comandos sql + ResultSet rs;//resultados de consulta. + + String CadenaConexion = "jdbc:postgresql://localhost:5432/nexo_gym"; //cadena de conección + String usuarioBD = "postgres"; + String contraBD = "pallmay1234";//tres4 + + + + public PGConexion() { + + try { + Class.forName("org.postgresql.Driver");//paquete jar que importamos para postgresql + } catch (ClassNotFoundException ex) { + Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); + } + + try { + con = DriverManager.getConnection(CadenaConexion, usuarioBD, contraBD);//conexion a la base + } catch (SQLException ex) { + Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); + } + + } + + public ResultSet consulta(String sqlc) { + + try { + + st = con.createStatement();//crear sentencia + rs = st.executeQuery(sqlc);//resultado de la consulta + return rs; + + } catch (SQLException ex) { + Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); + return null; + } + } + + public boolean accion(String sqla) { + + try { + + st = con.createStatement();//crear sentencia + boolean rb = st.execute(sqla); //metodo devuelve un booleano de acuerdo a la ejecucion de la consulta + st.close(); //cerramos la conexion + return true;//rb; + + } catch (SQLException ex) { + Logger.getLogger(PGConexion.class.getName()).log(Level.SEVERE, null, ex); + return false; + } + + } + +} diff --git a/src/modelo/dao/EmpleadoDao.java b/src/modelo/dao/EmpleadoDao.java new file mode 100644 index 0000000..674d869 --- /dev/null +++ b/src/modelo/dao/EmpleadoDao.java @@ -0,0 +1,63 @@ + +package modelo.dao; + +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import modelo.conexion.PGConexion; +import modelo.vo.EmpleadoVo; + +/** + * + * @author Alex + */ + +public class EmpleadoDao extends EmpleadoVo{ + private PGConexion conecta = new PGConexion(); + + //Constructor por defecto + public EmpleadoDao(){ + } + + //Constructor con parametros + public EmpleadoDao(int id_empleado, int id_persona, int id_cargo, Date fecha_contrato, double sueldo) { + super(id_empleado, id_persona, id_cargo, fecha_contrato, sueldo); + } + public List<EmpleadoVo> mostrarDatos() { + + List<EmpleadoVo> lista_empleados = new ArrayList<>(); + String sql = "select * from empleado order by 1"; + ResultSet rs = conecta.consulta(sql); + + try { + while (rs.next()) { + EmpleadoVo e1 = new EmpleadoDao(); + e1.setId_empleado(rs.getInt("id_empleado")); + e1.setId_persona(rs.getInt("id_persona")); + e1.setId_cargo(rs.getInt("id_cargo")); + e1.setFecha_contrato(rs.getDate("fecha_contrato")); + e1.setSueldo(rs.getDouble("sueldo")); + lista_empleados.add(e1); + } + rs.close();//cerramos conexion base. + return lista_empleados; + } catch (SQLException ex) { + Logger.getLogger(EmpleadoDao.class.getName()).log(Level.SEVERE, null, ex); + return null; + } + } + + //Metodo para grabar empleados + public boolean grabar(){ + String sql; + sql="INSERT INTO empleado(id_persona, id_cargo, fecha_contrato, sueldo) "; + sql+=" VALUES ('"+getId_persona()+"','"+getId_cargo()+"','"+getFecha_contrato()+"','"+getSueldo() + +"')"; + return conecta.accion(sql); + } + +} \ No newline at end of file diff --git a/src/modelo/vo/EmpleadoVo.java b/src/modelo/vo/EmpleadoVo.java index 62ba7a6..00606a9 100644 --- a/src/modelo/vo/EmpleadoVo.java +++ b/src/modelo/vo/EmpleadoVo.java @@ -1,66 +1,69 @@ - -package modelo.vo; - -import java.sql.Date; - - -public class EmpleadoVo { - - //atributos - private int id_empleado; - private int id_persona; // ----> FK - private int id_cargo; // ----> FK - private Date fecha_contrato; - private double sueldo; - - public EmpleadoVo(int id_empleado, int id_persona, int id_cargo, Date fecha_contrato, double sueldo) { - this.id_empleado = id_empleado; - this.id_persona = id_persona; - this.id_cargo = id_cargo; - this.fecha_contrato = fecha_contrato; - this.sueldo = sueldo; - } - - public int getId_empleado() { - return id_empleado; - } - - public void setId_empleado(int id_empleado) { - this.id_empleado = id_empleado; - } - - public int getId_persona() { - return id_persona; - } - - public void setId_persona(int id_persona) { - this.id_persona = id_persona; - } - - public int getId_cargo() { - return id_cargo; - } - - public void setId_cargo(int id_cargo) { - this.id_cargo = id_cargo; - } - - public Date getFecha_contrato() { - return fecha_contrato; - } - - public void setFecha_contrato(Date fecha_contrato) { - this.fecha_contrato = fecha_contrato; - } - - public double getSueldo() { - return sueldo; - } - - public void setSueldo(double sueldo) { - this.sueldo = sueldo; - } - - - -} + +package modelo.vo; + +import java.sql.Date; + + +public class EmpleadoVo { + + //atributos + private int id_empleado; + private int id_persona; // ----> FK + private int id_cargo; // ----> FK + private Date fecha_contrato; + private double sueldo; + + public EmpleadoVo() { + } + + public EmpleadoVo(int id_empleado, int id_persona, int id_cargo, Date fecha_contrato, double sueldo) { + this.id_empleado = id_empleado; + this.id_persona = id_persona; + this.id_cargo = id_cargo; + this.fecha_contrato = fecha_contrato; + this.sueldo = sueldo; + } + + public int getId_empleado() { + return id_empleado; + } + + public void setId_empleado(int id_empleado) { + this.id_empleado = id_empleado; + } + + public int getId_persona() { + return id_persona; + } + + public void setId_persona(int id_persona) { + this.id_persona = id_persona; + } + + public int getId_cargo() { + return id_cargo; + } + + public void setId_cargo(int id_cargo) { + this.id_cargo = id_cargo; + } + + public Date getFecha_contrato() { + return fecha_contrato; + } + + public void setFecha_contrato(Date fecha_contrato) { + this.fecha_contrato = fecha_contrato; + } + + public double getSueldo() { + return sueldo; + } + + public void setSueldo(double sueldo) { + this.sueldo = sueldo; + } + + + +} diff --git a/src/vista/VistaRegistrar_Empleado.form b/src/vista/VistaRegistrar_Empleado.form new file mode 100644 index 0000000..0427a96 --- /dev/null +++ b/src/vista/VistaRegistrar_Empleado.form @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-19,0,0,2,31"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="lblTitulo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="REGISTRO DE EMPLEADOS"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="30" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="lblCedula"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Cedula"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="70" y="100" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="lblPersona"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Persona"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="70" y="140" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="lblCargo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Cargo"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="70" y="180" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="lblFecha"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Fecha de Contrato"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="70" y="220" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="lblSueldo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Sueldo"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="70" y="260" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JTextField" name="txtSueldo"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtSueldoActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="190" y="260" width="160" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="com.toedter.calendar.JDateChooser" name="fechaContrato"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="220" y="220" width="130" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JTextField" name="txtPersona"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="190" y="140" width="160" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JTextField" name="txtCedula"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtCedulaActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="190" y="100" width="160" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="btnRegistrarE"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Registrar Empleado"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRegistrarEActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="140" y="320" width="210" height="50"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="btnRegresar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Regresar"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="370" y="420" width="130" height="40"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JComboBox" name="cb_cargo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="190" y="180" width="160" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="lblFondo"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="2" y="0" width="540" height="490"/> + </Constraint> + </Constraints> + </Component> + </SubComponents> +</Form> diff --git a/src/vista/VistaRegistrar_Empleado.java b/src/vista/VistaRegistrar_Empleado.java new file mode 100644 index 0000000..c63702c --- /dev/null +++ b/src/vista/VistaRegistrar_Empleado.java @@ -0,0 +1,301 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package vista; + +import com.toedter.calendar.JDateChooser; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JTextField; + +/** + * + * @author DELL + */ +public class VistaRegistrar_Empleado extends javax.swing.JFrame { + + /** + * Creates new form VistaRegistar_E + */ + public VistaRegistrar_Empleado() { + initComponents(); + txtPersona.setEnabled(false); + + } + + public JButton getBtnRegistrarE() { + return btnRegistrarE; + } + + public void setBtnRegistrarE(JButton btnRegistrarE) { + this.btnRegistrarE = btnRegistrarE; + } + + public JButton getBtnRegresar() { + return btnRegresar; + } + + public void setBtnRegresar(JButton btnRegresar) { + this.btnRegresar = btnRegresar; + } + + public JDateChooser getFechaContrato() { + return fechaContrato; + } + + public void setFechaContrato(JDateChooser fechaContrato) { + this.fechaContrato = fechaContrato; + } + + public JLabel getLblCargo() { + return lblCargo; + } + + public void setLblCargo(JLabel lblCargo) { + this.lblCargo = lblCargo; + } + + public JLabel getLblCedula() { + return lblCedula; + } + + public void setLblCedula(JLabel lblCedula) { + this.lblCedula = lblCedula; + } + + public JLabel getLblFecha() { + return lblFecha; + } + + public void setLblFecha(JLabel lblFecha) { + this.lblFecha = lblFecha; + } + + public JLabel getLblFondo() { + return lblFondo; + } + + public void setLblFondo(JLabel lblFondo) { + this.lblFondo = lblFondo; + } + + public JLabel getLblPersona() { + return lblPersona; + } + + public void setLblPersona(JLabel lblPersona) { + this.lblPersona = lblPersona; + } + + public JLabel getLblSueldo() { + return lblSueldo; + } + + public void setLblSueldo(JLabel lblSueldo) { + this.lblSueldo = lblSueldo; + } + + public JLabel getLblTitulo() { + return lblTitulo; + } + + public void setLblTitulo(JLabel lblTitulo) { + this.lblTitulo = lblTitulo; + } + + + public JTextField getTxtCedula() { + return txtCedula; + } + + public void setTxtCedula(JTextField txtCedula) { + this.txtCedula = txtCedula; + } + + public JTextField getTxtPersona() { + return txtPersona; + } + + public void setTxtPersona(JTextField txtPersona) { + this.txtPersona = txtPersona; + } + + public JTextField getTxtSueldo() { + return txtSueldo; + } + + public void setTxtSueldo(JTextField txtSueldo) { + this.txtSueldo = txtSueldo; + } + + public JComboBox<String> getCb_cargo() { + return cb_cargo; + } + + public void setCb_cargo(JComboBox<String> cb_cargo) { + this.cb_cargo = cb_cargo; + } + + + /** + * 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() { + + lblTitulo = new javax.swing.JLabel(); + lblCedula = new javax.swing.JLabel(); + lblPersona = new javax.swing.JLabel(); + lblCargo = new javax.swing.JLabel(); + lblFecha = new javax.swing.JLabel(); + lblSueldo = new javax.swing.JLabel(); + txtSueldo = new javax.swing.JTextField(); + fechaContrato = new com.toedter.calendar.JDateChooser(); + txtPersona = new javax.swing.JTextField(); + txtCedula = new javax.swing.JTextField(); + btnRegistrarE = new javax.swing.JButton(); + btnRegresar = new javax.swing.JButton(); + cb_cargo = new javax.swing.JComboBox<>(); + lblFondo = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + lblTitulo.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N + lblTitulo.setText("REGISTRO DE EMPLEADOS"); + getContentPane().add(lblTitulo, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, -1, -1)); + + lblCedula.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + lblCedula.setText("Cedula"); + getContentPane().add(lblCedula, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 100, -1, -1)); + + lblPersona.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + lblPersona.setText("Persona"); + getContentPane().add(lblPersona, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 140, -1, -1)); + + lblCargo.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + lblCargo.setText("Cargo"); + getContentPane().add(lblCargo, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 180, -1, -1)); + + lblFecha.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + lblFecha.setText("Fecha de Contrato"); + getContentPane().add(lblFecha, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 220, -1, -1)); + + lblSueldo.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + lblSueldo.setText("Sueldo"); + getContentPane().add(lblSueldo, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 260, -1, -1)); + + txtSueldo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtSueldoActionPerformed(evt); + } + }); + getContentPane().add(txtSueldo, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 260, 160, 30)); + getContentPane().add(fechaContrato, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 220, 130, 30)); + getContentPane().add(txtPersona, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 140, 160, 30)); + + txtCedula.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtCedulaActionPerformed(evt); + } + }); + getContentPane().add(txtCedula, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 100, 160, 30)); + + btnRegistrarE.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + btnRegistrarE.setText("Registrar Empleado"); + btnRegistrarE.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRegistrarEActionPerformed(evt); + } + }); + getContentPane().add(btnRegistrarE, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 320, 210, 50)); + + btnRegresar.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + btnRegresar.setText("Regresar"); + getContentPane().add(btnRegresar, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 420, 130, 40)); + + cb_cargo.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + cb_cargo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + getContentPane().add(cb_cargo, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 180, 160, -1)); + getContentPane().add(lblFondo, new org.netbeans.lib.awtextra.AbsoluteConstraints(2, 0, 540, 490)); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void txtSueldoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSueldoActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtSueldoActionPerformed + + private void txtCedulaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCedulaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtCedulaActionPerformed + + private void btnRegistrarEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRegistrarEActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_btnRegistrarEActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Empleado.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Empleado().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnRegistrarE; + private javax.swing.JButton btnRegresar; + private javax.swing.JComboBox<String> cb_cargo; + private com.toedter.calendar.JDateChooser fechaContrato; + private javax.swing.JLabel lblCargo; + private javax.swing.JLabel lblCedula; + private javax.swing.JLabel lblFecha; + private javax.swing.JLabel lblFondo; + private javax.swing.JLabel lblPersona; + private javax.swing.JLabel lblSueldo; + private javax.swing.JLabel lblTitulo; + private javax.swing.JTextField txtCedula; + private javax.swing.JTextField txtPersona; + private javax.swing.JTextField txtSueldo; + // End of variables declaration//GEN-END:variables +} diff --git a/src/vista/VistaRegistrar_Membresia.java b/src/vista/VistaRegistrar_Membresia.java index 5a9cde6..391c63d 100644 --- a/src/vista/VistaRegistrar_Membresia.java +++ b/src/vista/VistaRegistrar_Membresia.java @@ -1,197 +1,197 @@ - -package vista; - -import javax.swing.JButton; -import javax.swing.JTextField; - - -public class VistaRegistrar_Membresia extends javax.swing.JFrame { - - - public VistaRegistrar_Membresia() { - initComponents(); - } - - @SuppressWarnings("unchecked") - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - - jLabel2 = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); - txt_descripcion = new javax.swing.JTextField(); - jLabel1 = new javax.swing.JLabel(); - txt_nombre = new javax.swing.JTextField(); - jLabel3 = new javax.swing.JLabel(); - txt_descuento = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); - bt_registrar = new javax.swing.JButton(); - - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - - jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N - jLabel2.setText("Registro de Membresías"); - - jLabel4.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel4.setText("Descripción:"); - - txt_descripcion.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txt_descripcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel1.setText("Nombre:"); - - txt_nombre.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txt_nombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel3.setText("Descuento:"); - - txt_descuento.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txt_descuento.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel5.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel5.setText("%"); - - bt_registrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - bt_registrar.setText("Registrar Membresía"); - bt_registrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(30, 30, 30) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel2) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel4) - .addComponent(txt_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 336, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) - .addComponent(bt_registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(30, 30, 30)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel1) - .addComponent(txt_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(txt_descuento, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel5))) - .addGap(47, 47, 47)))) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(23, 23, 23) - .addComponent(jLabel2) - .addGap(51, 51, 51) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txt_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel4)) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txt_descuento, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel5)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txt_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(bt_registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(50, Short.MAX_VALUE)) - ); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - public JButton getBt_registrar() { - return bt_registrar; - } - - public void setBt_registrar(JButton bt_registrar) { - this.bt_registrar = bt_registrar; - } - - public JTextField getTxt_descripcion() { - return txt_descripcion; - } - - public void setTxt_descripcion(JTextField txt_descripcion) { - this.txt_descripcion = txt_descripcion; - } - - public JTextField getTxt_descuento() { - return txt_descuento; - } - - public void setTxt_descuento(JTextField txt_descuento) { - this.txt_descuento = txt_descuento; - } - - public JTextField getTxt_nombre() { - return txt_nombre; - } - - public void setTxt_nombre(JTextField txt_nombre) { - this.txt_nombre = txt_nombre; - } - - - - public static void main(String args[]) { - /* Set the Nimbus look and feel */ - //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> - /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. - * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html - */ - try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } - //</editor-fold> - - /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new VistaRegistrar_Membresia().setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton bt_registrar; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JTextField txt_descripcion; - private javax.swing.JTextField txt_descuento; - private javax.swing.JTextField txt_nombre; - // End of variables declaration//GEN-END:variables -} + +package vista; + +import javax.swing.JButton; +import javax.swing.JTextField; + + +public class VistaRegistrar_Membresia extends javax.swing.JFrame { + + + public VistaRegistrar_Membresia() { + initComponents(); + } + + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel2 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + txt_descripcion = new javax.swing.JTextField(); + jLabel1 = new javax.swing.JLabel(); + txt_nombre = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + txt_descuento = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + bt_registrar = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N + jLabel2.setText("Registro de Membresías"); + + jLabel4.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel4.setText("Descripción:"); + + txt_descripcion.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txt_descripcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel1.setText("Nombre:"); + + txt_nombre.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txt_nombre.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel3.setText("Descuento:"); + + txt_descuento.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txt_descuento.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel5.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel5.setText("%"); + + bt_registrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + bt_registrar.setText("Registrar Membresía"); + bt_registrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(30, 30, 30) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4) + .addComponent(txt_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 336, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) + .addComponent(bt_registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(30, 30, 30)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(txt_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(txt_descuento, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel5))) + .addGap(47, 47, 47)))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(23, 23, 23) + .addComponent(jLabel2) + .addGap(51, 51, 51) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txt_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel4)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txt_descuento, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txt_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(bt_registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(50, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + public JButton getBt_registrar() { + return bt_registrar; + } + + public void setBt_registrar(JButton bt_registrar) { + this.bt_registrar = bt_registrar; + } + + public JTextField getTxt_descripcion() { + return txt_descripcion; + } + + public void setTxt_descripcion(JTextField txt_descripcion) { + this.txt_descripcion = txt_descripcion; + } + + public JTextField getTxt_descuento() { + return txt_descuento; + } + + public void setTxt_descuento(JTextField txt_descuento) { + this.txt_descuento = txt_descuento; + } + + public JTextField getTxt_nombre() { + return txt_nombre; + } + + public void setTxt_nombre(JTextField txt_nombre) { + this.txt_nombre = txt_nombre; + } + + + + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Membresia().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton bt_registrar; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JTextField txt_descripcion; + private javax.swing.JTextField txt_descuento; + private javax.swing.JTextField txt_nombre; + // End of variables declaration//GEN-END:variables +} diff --git a/src/vista/VistaRegistrar_Persona.form b/src/vista/VistaRegistrar_Persona.form index 5e2140a..c5006e3 100644 --- a/src/vista/VistaRegistrar_Persona.form +++ b/src/vista/VistaRegistrar_Persona.form @@ -1,253 +1,253 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="2"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="88" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel4" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="txtNombre" min="-2" pref="130" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> - <Component id="jLabel5" min="-2" max="-2" attributes="0"/> - </Group> - <Component id="txtDni" min="-2" pref="130" max="-2" attributes="0"/> - </Group> - <EmptySpace max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtDireccion" min="-2" pref="130" max="-2" attributes="0"/> - <Component id="txtCorreo" min="-2" pref="130" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel6" min="-2" max="-2" attributes="0"/> - <Group type="102" attributes="0"> - <Component id="jLabel8" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="DateFecha" min="-2" pref="130" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - </Group> - </Group> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="228" max="-2" attributes="0"/> - <Component id="jLabel11" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel7" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="399" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtTeléfono" min="-2" pref="130" max="-2" attributes="0"/> - <Component id="txtApellido" min="-2" pref="130" max="-2" attributes="0"/> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel9" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="69" max="-2" attributes="0"/> - <Component id="cbGenero" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace pref="87" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="DateFecha" min="-2" max="-2" attributes="0"/> - <Group type="102" attributes="0"> - <Component id="jLabel11" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/> - <Component id="txtDni" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="txtNombre" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtApellido" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtTeléfono" alignment="1" min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="txtCorreo" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="txtDireccion" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="cbGenero" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace pref="30" max="32767" attributes="0"/> - <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="jLabel11"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Registro Persona"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtNombre"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel2"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Nombre"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtCorreo"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Correo"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtDni"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel4"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Cédula"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtApellido"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel5"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Apellido"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtTeléfono"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel6"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Teléfono"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtDireccion"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel7"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Dirección"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel8"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Fecha de Nacimiento"/> - </Properties> - </Component> - <Component class="com.toedter.calendar.JDateChooser" name="DateFecha"> - </Component> - <Component class="javax.swing.JComboBox" name="cbGenero"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="2"> - <StringItem index="0" value="M"/> - <StringItem index="1" value="F"/> - </StringArray> - </Property> - </Properties> - <AuxValues> - <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> - </AuxValues> - </Component> - <Component class="javax.swing.JLabel" name="jLabel9"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Género"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnRegistrar"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Registrar Persona"/> - </Properties> - </Component> - </SubComponents> -</Form> +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="88" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="txtNombre" min="-2" pref="130" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="txtDni" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtDireccion" min="-2" pref="130" max="-2" attributes="0"/> + <Component id="txtCorreo" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="DateFecha" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="228" max="-2" attributes="0"/> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="399" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtTeléfono" min="-2" pref="130" max="-2" attributes="0"/> + <Component id="txtApellido" min="-2" pref="130" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="69" max="-2" attributes="0"/> + <Component id="cbGenero" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="87" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="DateFecha" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="txtDni" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtNombre" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtApellido" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtTeléfono" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtCorreo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtDireccion" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="cbGenero" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="30" max="32767" attributes="0"/> + <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Registro Persona"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNombre"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Nombre"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCorreo"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Correo"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDni"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Cédula"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtApellido"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Apellido"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTeléfono"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Teléfono"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDireccion"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Dirección"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Fecha de Nacimiento"/> + </Properties> + </Component> + <Component class="com.toedter.calendar.JDateChooser" name="DateFecha"> + </Component> + <Component class="javax.swing.JComboBox" name="cbGenero"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="2"> + <StringItem index="0" value="M"/> + <StringItem index="1" value="F"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Género"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnRegistrar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Registrar Persona"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/src/vista/VistaRegistrar_Persona.java b/src/vista/VistaRegistrar_Persona.java index d02712b..b2fffc8 100644 --- a/src/vista/VistaRegistrar_Persona.java +++ b/src/vista/VistaRegistrar_Persona.java @@ -1,319 +1,319 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package vista; - -import com.toedter.calendar.JDateChooser; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JTable; -import javax.swing.JTextField; - -/** - * - * @author Usuario - */ -public class VistaRegistrar_Persona extends javax.swing.JFrame { - - /** - * Creates new form VistaPersona - */ - public VistaRegistrar_Persona() { - initComponents(); - } - - public JDateChooser getDateFecha() { - return DateFecha; - } - - public void setDateFecha(JDateChooser DateFecha) { - this.DateFecha = DateFecha; - } - - public JButton getBtnRegistrar() { - return btnRegistrar; - } - - public void setBtnRegistrar(JButton btnRegistrar) { - this.btnRegistrar = btnRegistrar; - } - - public JTextField getTxtApellido() { - return txtApellido; - } - - public void setTxtApellido(JTextField txtApellido) { - this.txtApellido = txtApellido; - } - - public JTextField getTxtCorreo() { - return txtCorreo; - } - - public void setTxtCorreo(JTextField txtCorreo) { - this.txtCorreo = txtCorreo; - } - - public JTextField getTxtDireccion() { - return txtDireccion; - } - - public void setTxtDireccion(JTextField txtDireccion) { - this.txtDireccion = txtDireccion; - } - - public JTextField getTxtDni() { - return txtDni; - } - - public void setTxtDni(JTextField txtDni) { - this.txtDni = txtDni; - } - - public JTextField getTxtNombre() { - return txtNombre; - } - - public void setTxtNombre(JTextField txtNombre) { - this.txtNombre = txtNombre; - } - - public JTextField getTxtTeléfono() { - return txtTeléfono; - } - - public void setTxtTeléfono(JTextField txtTeléfono) { - this.txtTeléfono = txtTeléfono; - } - - public JComboBox<String> getCbGenero() { - return cbGenero; - } - - public void setCbGenero(JComboBox<String> cbGenero) { - this.cbGenero = cbGenero; - } - - - - - /** - * 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() { - - jLabel11 = new javax.swing.JLabel(); - txtNombre = new javax.swing.JTextField(); - jLabel2 = new javax.swing.JLabel(); - txtCorreo = new javax.swing.JTextField(); - jLabel3 = new javax.swing.JLabel(); - txtDni = new javax.swing.JTextField(); - jLabel4 = new javax.swing.JLabel(); - txtApellido = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); - txtTeléfono = new javax.swing.JTextField(); - jLabel6 = new javax.swing.JLabel(); - txtDireccion = new javax.swing.JTextField(); - jLabel7 = new javax.swing.JLabel(); - jLabel8 = new javax.swing.JLabel(); - DateFecha = new com.toedter.calendar.JDateChooser(); - cbGenero = new javax.swing.JComboBox<>(); - jLabel9 = new javax.swing.JLabel(); - btnRegistrar = new javax.swing.JButton(); - - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - - jLabel11.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel11.setText("Registro Persona"); - - jLabel2.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel2.setText("Nombre"); - - jLabel3.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel3.setText("Correo"); - - jLabel4.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel4.setText("Cédula"); - - jLabel5.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel5.setText("Apellido"); - - jLabel6.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel6.setText("Teléfono"); - - jLabel7.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel7.setText("Dirección"); - - jLabel8.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel8.setText("Fecha de Nacimiento"); - - cbGenero.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "M", "F" })); - - jLabel9.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - jLabel9.setText("Género"); - - btnRegistrar.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N - btnRegistrar.setText("Registrar Persona"); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnRegistrar) - .addGap(88, 88, 88)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel4) - .addGap(73, 73, 73) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(66, 66, 66) - .addComponent(jLabel5)) - .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(66, 66, 66) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel6) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel8) - .addGap(18, 18, 18) - .addComponent(DateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 0, Short.MAX_VALUE)))) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(228, 228, 228) - .addComponent(jLabel11)) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) - .addComponent(jLabel3) - .addComponent(jLabel7)) - .addGap(399, 399, 399) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtTeléfono, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel9) - .addGap(69, 69, 69) - .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(87, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(35, 35, 35) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(DateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel11) - .addGap(79, 79, 79) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel2) - .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel5)) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtTeléfono, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel3) - .addComponent(jLabel6))) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel7) - .addComponent(jLabel8)))) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel9)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE) - .addComponent(btnRegistrar) - .addGap(20, 20, 20)) - ); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - /** - * @param args the command line arguments - */ - - public static void main(String args[]) { - /* Set the Nimbus look and feel */ - //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> - /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. - * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html - */ - try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } - //</editor-fold> - - /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new VistaRegistrar_Persona().setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private com.toedter.calendar.JDateChooser DateFecha; - private javax.swing.JButton btnRegistrar; - private javax.swing.JComboBox<String> cbGenero; - private javax.swing.JLabel jLabel11; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JLabel jLabel8; - private javax.swing.JLabel jLabel9; - private javax.swing.JTextField txtApellido; - private javax.swing.JTextField txtCorreo; - private javax.swing.JTextField txtDireccion; - private javax.swing.JTextField txtDni; - private javax.swing.JTextField txtNombre; - private javax.swing.JTextField txtTeléfono; - // End of variables declaration//GEN-END:variables -} +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package vista; + +import com.toedter.calendar.JDateChooser; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.JTextField; + +/** + * + * @author Usuario + */ +public class VistaRegistrar_Persona extends javax.swing.JFrame { + + /** + * Creates new form VistaPersona + */ + public VistaRegistrar_Persona() { + initComponents(); + } + + public JDateChooser getDateFecha() { + return DateFecha; + } + + public void setDateFecha(JDateChooser DateFecha) { + this.DateFecha = DateFecha; + } + + public JButton getBtnRegistrar() { + return btnRegistrar; + } + + public void setBtnRegistrar(JButton btnRegistrar) { + this.btnRegistrar = btnRegistrar; + } + + public JTextField getTxtApellido() { + return txtApellido; + } + + public void setTxtApellido(JTextField txtApellido) { + this.txtApellido = txtApellido; + } + + public JTextField getTxtCorreo() { + return txtCorreo; + } + + public void setTxtCorreo(JTextField txtCorreo) { + this.txtCorreo = txtCorreo; + } + + public JTextField getTxtDireccion() { + return txtDireccion; + } + + public void setTxtDireccion(JTextField txtDireccion) { + this.txtDireccion = txtDireccion; + } + + public JTextField getTxtDni() { + return txtDni; + } + + public void setTxtDni(JTextField txtDni) { + this.txtDni = txtDni; + } + + public JTextField getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(JTextField txtNombre) { + this.txtNombre = txtNombre; + } + + public JTextField getTxtTeléfono() { + return txtTeléfono; + } + + public void setTxtTeléfono(JTextField txtTeléfono) { + this.txtTeléfono = txtTeléfono; + } + + public JComboBox<String> getCbGenero() { + return cbGenero; + } + + public void setCbGenero(JComboBox<String> cbGenero) { + this.cbGenero = cbGenero; + } + + + + + /** + * 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() { + + jLabel11 = new javax.swing.JLabel(); + txtNombre = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + txtCorreo = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + txtDni = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + txtApellido = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + txtTeléfono = new javax.swing.JTextField(); + jLabel6 = new javax.swing.JLabel(); + txtDireccion = new javax.swing.JTextField(); + jLabel7 = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + DateFecha = new com.toedter.calendar.JDateChooser(); + cbGenero = new javax.swing.JComboBox<>(); + jLabel9 = new javax.swing.JLabel(); + btnRegistrar = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + jLabel11.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel11.setText("Registro Persona"); + + jLabel2.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel2.setText("Nombre"); + + jLabel3.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel3.setText("Correo"); + + jLabel4.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel4.setText("Cédula"); + + jLabel5.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel5.setText("Apellido"); + + jLabel6.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel6.setText("Teléfono"); + + jLabel7.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel7.setText("Dirección"); + + jLabel8.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel8.setText("Fecha de Nacimiento"); + + cbGenero.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "M", "F" })); + + jLabel9.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + jLabel9.setText("Género"); + + btnRegistrar.setFont(new java.awt.Font("Trebuchet MS", 0, 14)); // NOI18N + btnRegistrar.setText("Registrar Persona"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnRegistrar) + .addGap(88, 88, 88)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel4) + .addGap(73, 73, 73) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(66, 66, 66) + .addComponent(jLabel5)) + .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(66, 66, 66) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel8) + .addGap(18, 18, 18) + .addComponent(DateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE)))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(228, 228, 228) + .addComponent(jLabel11)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel7)) + .addGap(399, 399, 399) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtTeléfono, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel9) + .addGap(69, 69, 69) + .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(87, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(35, 35, 35) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(DateFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel11) + .addGap(79, 79, 79) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtTeléfono, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3) + .addComponent(jLabel6))) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(jLabel8)))) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(cbGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel9)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE) + .addComponent(btnRegistrar) + .addGap(20, 20, 20)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Membresia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Persona().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private com.toedter.calendar.JDateChooser DateFecha; + private javax.swing.JButton btnRegistrar; + private javax.swing.JComboBox<String> cbGenero; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JTextField txtApellido; + private javax.swing.JTextField txtCorreo; + private javax.swing.JTextField txtDireccion; + private javax.swing.JTextField txtDni; + private javax.swing.JTextField txtNombre; + private javax.swing.JTextField txtTeléfono; + // End of variables declaration//GEN-END:variables +} diff --git a/src/vista/VistaRegistrar_Rutina.form b/src/vista/VistaRegistrar_Rutina.form index 5fcafbf..6d17c76 100644 --- a/src/vista/VistaRegistrar_Rutina.form +++ b/src/vista/VistaRegistrar_Rutina.form @@ -1,137 +1,137 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="3"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="jScrollPane1" max="32767" attributes="0"/> - <Component id="txtNombre" max="32767" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="119" max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="179" max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="201" max="-2" attributes="0"/> - <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> - <Component id="txtNombre" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <Component id="jScrollPane1" min="-2" pref="74" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="26" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="jLabel1"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Registro de Rutina"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel2"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Nombre:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtNombre"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Descripcion:"/> - </Properties> - </Component> - <Container class="javax.swing.JScrollPane" name="jScrollPane1"> - <AuxValues> - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> - </AuxValues> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTextArea" name="txtDescripcion"> - <Properties> - <Property name="columns" type="int" value="20"/> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="lineWrap" type="boolean" value="true"/> - <Property name="rows" type="int" value="5"/> - <Property name="wrapStyleWord" type="boolean" value="true"/> - </Properties> - </Component> - </SubComponents> - </Container> - <Component class="javax.swing.JToggleButton" name="btnRegistrar"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Registrar"/> - </Properties> - </Component> - </SubComponents> -</Form> +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jScrollPane1" max="32767" attributes="0"/> + <Component id="txtNombre" max="32767" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="119" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="179" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="201" max="-2" attributes="0"/> + <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <Component id="txtNombre" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="74" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnRegistrar" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="26" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Registro de Rutina"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Nombre:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNombre"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Descripcion:"/> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTextArea" name="txtDescripcion"> + <Properties> + <Property name="columns" type="int" value="20"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="lineWrap" type="boolean" value="true"/> + <Property name="rows" type="int" value="5"/> + <Property name="wrapStyleWord" type="boolean" value="true"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JToggleButton" name="btnRegistrar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Registrar"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/src/vista/VistaRegistrar_Rutina.java b/src/vista/VistaRegistrar_Rutina.java index c2baf7b..5763cca 100644 --- a/src/vista/VistaRegistrar_Rutina.java +++ b/src/vista/VistaRegistrar_Rutina.java @@ -1,178 +1,178 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package vista; - -import javax.swing.JTextArea; -import javax.swing.JTextField; -import javax.swing.JToggleButton; - -/** - * - * @author Casa - */ -public class VistaRegistrar_Rutina extends javax.swing.JFrame { - - /** - * Creates new form VistaRegistrar_Rutina - */ - public VistaRegistrar_Rutina() { - initComponents(); - } - - public JToggleButton getBtnRegistrar() { - return btnRegistrar; - } - - public void setBtnRegistrar(JToggleButton btnRegistrar) { - this.btnRegistrar = btnRegistrar; - } - - public JTextArea getTxtDescripcion() { - return txtDescripcion; - } - - public void setTxtDescripcion(JTextArea txtDescripcion) { - this.txtDescripcion = txtDescripcion; - } - - public JTextField getTxtNombre() { - return txtNombre; - } - - public void setTxtNombre(JTextField txtNombre) { - this.txtNombre = txtNombre; - } - - /** - * 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() { - - jLabel1 = new javax.swing.JLabel(); - jLabel2 = new javax.swing.JLabel(); - txtNombre = new javax.swing.JTextField(); - jLabel3 = new javax.swing.JLabel(); - jScrollPane1 = new javax.swing.JScrollPane(); - txtDescripcion = new javax.swing.JTextArea(); - btnRegistrar = new javax.swing.JToggleButton(); - - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - - jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N - jLabel1.setText("Registro de Rutina"); - - jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel2.setText("Nombre:"); - - txtNombre.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - - jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel3.setText("Descripcion:"); - - txtDescripcion.setColumns(20); - txtDescripcion.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txtDescripcion.setLineWrap(true); - txtDescripcion.setRows(5); - txtDescripcion.setWrapStyleWord(true); - jScrollPane1.setViewportView(txtDescripcion); - - btnRegistrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - btnRegistrar.setText("Registrar"); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(40, 40, 40) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel3) - .addComponent(jLabel2)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jScrollPane1) - .addComponent(txtNombre)) - .addGap(119, 119, 119)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(179, 179, 179) - .addComponent(jLabel1)) - .addGroup(layout.createSequentialGroup() - .addGap(201, 201, 201) - .addComponent(btnRegistrar))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel1) - .addGap(32, 32, 32) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) - .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(25, 25, 25) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel3) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addComponent(btnRegistrar) - .addContainerGap(26, Short.MAX_VALUE)) - ); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - /** - * @param args the command line arguments - */ - public static void main(String args[]) { - /* Set the Nimbus look and feel */ - //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> - /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. - * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html - */ - try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } - //</editor-fold> - - /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new VistaRegistrar_Rutina().setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JToggleButton btnRegistrar; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JTextArea txtDescripcion; - private javax.swing.JTextField txtNombre; - // End of variables declaration//GEN-END:variables -} +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package vista; + +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JToggleButton; + +/** + * + * @author Casa + */ +public class VistaRegistrar_Rutina extends javax.swing.JFrame { + + /** + * Creates new form VistaRegistrar_Rutina + */ + public VistaRegistrar_Rutina() { + initComponents(); + } + + public JToggleButton getBtnRegistrar() { + return btnRegistrar; + } + + public void setBtnRegistrar(JToggleButton btnRegistrar) { + this.btnRegistrar = btnRegistrar; + } + + public JTextArea getTxtDescripcion() { + return txtDescripcion; + } + + public void setTxtDescripcion(JTextArea txtDescripcion) { + this.txtDescripcion = txtDescripcion; + } + + public JTextField getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(JTextField txtNombre) { + this.txtNombre = txtNombre; + } + + /** + * 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() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + txtNombre = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtDescripcion = new javax.swing.JTextArea(); + btnRegistrar = new javax.swing.JToggleButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N + jLabel1.setText("Registro de Rutina"); + + jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel2.setText("Nombre:"); + + txtNombre.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + + jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel3.setText("Descripcion:"); + + txtDescripcion.setColumns(20); + txtDescripcion.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txtDescripcion.setLineWrap(true); + txtDescripcion.setRows(5); + txtDescripcion.setWrapStyleWord(true); + jScrollPane1.setViewportView(txtDescripcion); + + btnRegistrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + btnRegistrar.setText("Registrar"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(40, 40, 40) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel3) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jScrollPane1) + .addComponent(txtNombre)) + .addGap(119, 119, 119)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(179, 179, 179) + .addComponent(jLabel1)) + .addGroup(layout.createSequentialGroup() + .addGap(201, 201, 201) + .addComponent(btnRegistrar))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(32, 32, 32) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(25, 25, 25) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addComponent(btnRegistrar) + .addContainerGap(26, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Rutina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Rutina().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JToggleButton btnRegistrar; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea txtDescripcion; + private javax.swing.JTextField txtNombre; + // End of variables declaration//GEN-END:variables +} diff --git a/src/vista/VistaRegistrar_Usuario.form b/src/vista/VistaRegistrar_Usuario.form index a9e0dba..c0c5e1c 100644 --- a/src/vista/VistaRegistrar_Usuario.form +++ b/src/vista/VistaRegistrar_Usuario.form @@ -1,272 +1,272 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="3"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="txt_cedula" alignment="0" pref="242" max="32767" attributes="0"/> - <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="cb_rol" alignment="0" max="32767" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="bt_check" min="-2" max="-2" attributes="0"/> - </Group> - <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="txt_persona" alignment="0" min="-2" pref="242" max="-2" attributes="0"/> - </Group> - <EmptySpace pref="79" max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0"> - <Component id="jLabel5" min="-2" max="-2" attributes="0"/> - <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jconfirm_pass" alignment="0" max="32767" attributes="0"/> - <Component id="bt_registrar" alignment="1" max="32767" attributes="0"/> - <Component id="jpass" min="-2" pref="242" max="-2" attributes="0"/> - </Group> - <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="txt_user" alignment="0" min="-2" pref="242" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="txt_cedula" min="-2" pref="32" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel7" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="txt_persona" min="-2" pref="32" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="cb_rol" min="-2" pref="32" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="83" max="-2" attributes="0"/> - <Component id="bt_check" min="-2" pref="32" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> - <Component id="jLabel4" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="txt_user" min="-2" pref="32" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel5" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="jpass" min="-2" pref="32" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel6" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="jconfirm_pass" min="-2" pref="32" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> - <Component id="bt_registrar" min="-2" pref="49" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace pref="29" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="jLabel1"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Cedula:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txt_cedula"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> - </LineBorder> - </Border> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel2"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Registro de Usuarios"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Rol:"/> - </Properties> - </Component> - <Component class="javax.swing.JComboBox" name="cb_rol"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="0"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> - </LineBorder> - </Border> - </Property> - </Properties> - <AuxValues> - <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> - </AuxValues> - </Component> - <Component class="javax.swing.JLabel" name="jLabel4"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Usuario:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txt_user"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> - </LineBorder> - </Border> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel5"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Contraseña:"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel6"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Confirmar Contraseña:"/> - </Properties> - </Component> - <Component class="javax.swing.JPasswordField" name="jconfirm_pass"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> - </LineBorder> - </Border> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="bt_registrar"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Registrar Usuario"/> - <Property name="horizontalTextPosition" type="int" value="0"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="bt_check"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="-"/> - <Property name="horizontalTextPosition" type="int" value="0"/> - </Properties> - </Component> - <Component class="javax.swing.JPasswordField" name="jpass"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> - </LineBorder> - </Border> - </Property> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel7"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Persona:"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txt_persona"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Trebuchet MS" size="16" style="0"/> - </Property> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> - </LineBorder> - </Border> - </Property> - <Property name="enabled" type="boolean" value="false"/> - </Properties> - </Component> - </SubComponents> -</Form> +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="txt_cedula" alignment="0" pref="242" max="32767" attributes="0"/> + <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="cb_rol" alignment="0" max="32767" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="bt_check" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="txt_persona" alignment="0" min="-2" pref="242" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="79" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jconfirm_pass" alignment="0" max="32767" attributes="0"/> + <Component id="bt_registrar" alignment="1" max="32767" attributes="0"/> + <Component id="jpass" min="-2" pref="242" max="-2" attributes="0"/> + </Group> + <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="txt_user" alignment="0" min="-2" pref="242" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txt_cedula" min="-2" pref="32" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txt_persona" min="-2" pref="32" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="cb_rol" min="-2" pref="32" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="83" max="-2" attributes="0"/> + <Component id="bt_check" min="-2" pref="32" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txt_user" min="-2" pref="32" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jpass" min="-2" pref="32" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jconfirm_pass" min="-2" pref="32" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Component id="bt_registrar" min="-2" pref="49" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="29" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Cedula:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txt_cedula"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Registro de Usuarios"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Rol:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="cb_rol"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Usuario:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txt_user"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Contraseña:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Confirmar Contraseña:"/> + </Properties> + </Component> + <Component class="javax.swing.JPasswordField" name="jconfirm_pass"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="bt_registrar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Registrar Usuario"/> + <Property name="horizontalTextPosition" type="int" value="0"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="bt_check"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="-"/> + <Property name="horizontalTextPosition" type="int" value="0"/> + </Properties> + </Component> + <Component class="javax.swing.JPasswordField" name="jpass"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Persona:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txt_persona"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Trebuchet MS" size="16" style="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder> + <Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/> + </LineBorder> + </Border> + </Property> + <Property name="enabled" type="boolean" value="false"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/src/vista/VistaRegistrar_Usuario.java b/src/vista/VistaRegistrar_Usuario.java index 558ea1b..6707cab 100644 --- a/src/vista/VistaRegistrar_Usuario.java +++ b/src/vista/VistaRegistrar_Usuario.java @@ -1,277 +1,277 @@ - -package vista; - -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JPasswordField; -import javax.swing.JTextField; - -public class VistaRegistrar_Usuario extends javax.swing.JFrame { - - - public VistaRegistrar_Usuario() { - initComponents(); - } - - /** - * 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() { - - jLabel1 = new javax.swing.JLabel(); - txt_cedula = new javax.swing.JTextField(); - jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - cb_rol = new javax.swing.JComboBox<>(); - jLabel4 = new javax.swing.JLabel(); - txt_user = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - jconfirm_pass = new javax.swing.JPasswordField(); - bt_registrar = new javax.swing.JButton(); - bt_check = new javax.swing.JButton(); - jpass = new javax.swing.JPasswordField(); - jLabel7 = new javax.swing.JLabel(); - txt_persona = new javax.swing.JTextField(); - - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - - jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel1.setText("Cedula:"); - - txt_cedula.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txt_cedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N - jLabel2.setText("Registro de Usuarios"); - - jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel3.setText("Rol:"); - - cb_rol.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - cb_rol.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel4.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel4.setText("Usuario:"); - - txt_user.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txt_user.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel5.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel5.setText("Contraseña:"); - - jLabel6.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel6.setText("Confirmar Contraseña:"); - - jconfirm_pass.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - jconfirm_pass.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - bt_registrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - bt_registrar.setText("Registrar Usuario"); - bt_registrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - - bt_check.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - bt_check.setText("-"); - bt_check.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); - - jpass.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - jpass.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - - jLabel7.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N - jLabel7.setText("Persona:"); - - txt_persona.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N - txt_persona.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); - txt_persona.setEnabled(false); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(30, 30, 30) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jLabel1) - .addComponent(txt_cedula, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE) - .addComponent(jLabel2) - .addComponent(jLabel3) - .addComponent(cb_rol, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGap(18, 18, 18) - .addComponent(bt_check)) - .addComponent(jLabel7) - .addComponent(txt_persona, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 79, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jLabel5) - .addComponent(jLabel6) - .addComponent(jconfirm_pass) - .addComponent(bt_registrar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jpass, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jLabel4) - .addComponent(txt_user, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(30, 30, 30)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(23, 23, 23) - .addComponent(jLabel2) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(51, 51, 51) - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txt_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel7) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txt_persona, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(cb_rol, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGap(83, 83, 83) - .addComponent(bt_check, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addGap(51, 51, 51) - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txt_user, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jpass, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel6) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jconfirm_pass, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(39, 39, 39) - .addComponent(bt_registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(29, Short.MAX_VALUE)) - ); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - public JButton getBt_check() { - return bt_check; - } - - public void setBt_check(JButton bt_check) { - this.bt_check = bt_check; - } - - public JButton getBt_registrar() { - return bt_registrar; - } - - public void setBt_registrar(JButton bt_registrar) { - this.bt_registrar = bt_registrar; - } - - public JComboBox<String> getCb_rol() { - return cb_rol; - } - - public void setCb_rol(JComboBox<String> cb_rol) { - this.cb_rol = cb_rol; - } - - public JPasswordField getJconfirm_pass() { - return jconfirm_pass; - } - - public void setJconfirm_pass(JPasswordField jconfirm_pass) { - this.jconfirm_pass = jconfirm_pass; - } - - public JPasswordField getJpass() { - return jpass; - } - - public void setJpass(JPasswordField jpass) { - this.jpass = jpass; - } - - public JTextField getTxt_cedula() { - return txt_cedula; - } - - public void setTxt_cedula(JTextField txt_cedula) { - this.txt_cedula = txt_cedula; - } - - public JTextField getTxt_user() { - return txt_user; - } - - public void setTxt_user(JTextField txt_user) { - this.txt_user = txt_user; - } - - public JTextField getTxt_persona() { - return txt_persona; - } - - public void setTxt_persona(JTextField txt_persona) { - this.txt_persona = txt_persona; - } - - public static void main(String args[]) { - /* Set the Nimbus look and feel */ - //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> - /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. - * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html - */ - try { - for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } - } - } catch (ClassNotFoundException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } - //</editor-fold> - - /* Create and display the form */ - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new VistaRegistrar_Usuario().setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton bt_check; - private javax.swing.JButton bt_registrar; - private javax.swing.JComboBox<String> cb_rol; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JPasswordField jconfirm_pass; - private javax.swing.JPasswordField jpass; - private javax.swing.JTextField txt_cedula; - private javax.swing.JTextField txt_persona; - private javax.swing.JTextField txt_user; - // End of variables declaration//GEN-END:variables -} + +package vista; + +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JPasswordField; +import javax.swing.JTextField; + +public class VistaRegistrar_Usuario extends javax.swing.JFrame { + + + public VistaRegistrar_Usuario() { + initComponents(); + } + + /** + * 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() { + + jLabel1 = new javax.swing.JLabel(); + txt_cedula = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + cb_rol = new javax.swing.JComboBox<>(); + jLabel4 = new javax.swing.JLabel(); + txt_user = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jconfirm_pass = new javax.swing.JPasswordField(); + bt_registrar = new javax.swing.JButton(); + bt_check = new javax.swing.JButton(); + jpass = new javax.swing.JPasswordField(); + jLabel7 = new javax.swing.JLabel(); + txt_persona = new javax.swing.JTextField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel1.setText("Cedula:"); + + txt_cedula.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txt_cedula.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 18)); // NOI18N + jLabel2.setText("Registro de Usuarios"); + + jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel3.setText("Rol:"); + + cb_rol.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + cb_rol.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel4.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel4.setText("Usuario:"); + + txt_user.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txt_user.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel5.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel5.setText("Contraseña:"); + + jLabel6.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel6.setText("Confirmar Contraseña:"); + + jconfirm_pass.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + jconfirm_pass.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + bt_registrar.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + bt_registrar.setText("Registrar Usuario"); + bt_registrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + + bt_check.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + bt_check.setText("-"); + bt_check.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + + jpass.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + jpass.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + + jLabel7.setFont(new java.awt.Font("Trebuchet MS", 1, 16)); // NOI18N + jLabel7.setText("Persona:"); + + txt_persona.setFont(new java.awt.Font("Trebuchet MS", 0, 16)); // NOI18N + txt_persona.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + txt_persona.setEnabled(false); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(30, 30, 30) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jLabel1) + .addComponent(txt_cedula, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(cb_rol, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(18, 18, 18) + .addComponent(bt_check)) + .addComponent(jLabel7) + .addComponent(txt_persona, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 79, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jLabel5) + .addComponent(jLabel6) + .addComponent(jconfirm_pass) + .addComponent(bt_registrar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jpass, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabel4) + .addComponent(txt_user, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(30, 30, 30)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(23, 23, 23) + .addComponent(jLabel2) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(51, 51, 51) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txt_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txt_persona, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(cb_rol, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(83, 83, 83) + .addComponent(bt_check, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(51, 51, 51) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txt_user, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jpass, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jconfirm_pass, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(39, 39, 39) + .addComponent(bt_registrar, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(29, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + public JButton getBt_check() { + return bt_check; + } + + public void setBt_check(JButton bt_check) { + this.bt_check = bt_check; + } + + public JButton getBt_registrar() { + return bt_registrar; + } + + public void setBt_registrar(JButton bt_registrar) { + this.bt_registrar = bt_registrar; + } + + public JComboBox<String> getCb_rol() { + return cb_rol; + } + + public void setCb_rol(JComboBox<String> cb_rol) { + this.cb_rol = cb_rol; + } + + public JPasswordField getJconfirm_pass() { + return jconfirm_pass; + } + + public void setJconfirm_pass(JPasswordField jconfirm_pass) { + this.jconfirm_pass = jconfirm_pass; + } + + public JPasswordField getJpass() { + return jpass; + } + + public void setJpass(JPasswordField jpass) { + this.jpass = jpass; + } + + public JTextField getTxt_cedula() { + return txt_cedula; + } + + public void setTxt_cedula(JTextField txt_cedula) { + this.txt_cedula = txt_cedula; + } + + public JTextField getTxt_user() { + return txt_user; + } + + public void setTxt_user(JTextField txt_user) { + this.txt_user = txt_user; + } + + public JTextField getTxt_persona() { + return txt_persona; + } + + public void setTxt_persona(JTextField txt_persona) { + this.txt_persona = txt_persona; + } + + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(VistaRegistrar_Usuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new VistaRegistrar_Usuario().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton bt_check; + private javax.swing.JButton bt_registrar; + private javax.swing.JComboBox<String> cb_rol; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JPasswordField jconfirm_pass; + private javax.swing.JPasswordField jpass; + private javax.swing.JTextField txt_cedula; + private javax.swing.JTextField txt_persona; + private javax.swing.JTextField txt_user; + // End of variables declaration//GEN-END:variables +}