Professional Documents
Culture Documents
Saltillo
Hoja 2 de 2
PROGRAMACIÓN LÓGICA
Saltillo
Hoja 3 de 2
PROGRAMACIÓN LÓGICA
Saltillo
Hoja 4 de 2
PROGRAMACIÓN LÓGICA
}
public class Empleados extends javax.swing.JFrame {
public Empleados() {
initComponents();
dtm.addColumn("NOMBRE");
dtm.addColumn("APELLIDO");
dtm.addColumn("DIRECCION");
dtm.addColumn("C.P.");
dtm.addColumn("T.MOVIL");
dtm.addColumn("T.FIJO");
dtm.addColumn("E.CIVIL");
jTable1 = new JTable(dtm);
jScrollPane1.setViewportView(jTable1);
}
static ArrayList<ClaseEmpleados> Persona = new
ArrayList<ClaseEmpleados>();
static String Datos = "LOS DATOS E LA CLASE PERSONA SON...\n";
static int op;
Saltillo
Hoja 5 de 2
PROGRAMACIÓN LÓGICA
Elemento.setDireccion(direccion.getText());
Elemento.setCP(cp.getText());
Elemento.setTmovil(tmovil.getText());
Elemento.setTfijo(tfijo.getText());
Elemento.setEcivil(estadocivil.getSelectedItem().toString());
Elemento.setEleccion(estadocivil.getSelectedIndex());
Persona.add(Elemento);
nombre.setText(null);
apellido.setText(null);
direccion.setText(null);
cp.setText(null);
tmovil.setText(null);
tfijo.setText(null);
estadocivil.setSelectedIndex(0);
}
Saltillo
Hoja 6 de 2
PROGRAMACIÓN LÓGICA
}
if (Encontrado == false) {
JOptionPane.showMessageDialog(null, "+++Datos no
encontrados+++\n\n"
+ "Nombre incorrecto o Apellido Incorrecto", "APP Empleados", 0);
nombre.setText(null);
apellido.setText(null);
direccion.setText(null);
cp.setText(null);
tmovil.setText(null);
tfijo.setText(null);
estadocivil.setSelectedIndex(0);
}
}
Saltillo
Hoja 7 de 2
PROGRAMACIÓN LÓGICA
}
while (dtm.getRowCount() > 0) {
dtm.removeRow(0);
}
nombre.setText(null);
apellido.setText(null);
direccion.setText(null);
cp.setText(null);
tmovil.setText(null);
tfijo.setText(null);
estadocivil.setSelectedIndex(0);
}
Saltillo