Proyecto clínica codigo

21
Proyecto clínica DEPARTAMENTOS: package formularios; public class departamentos extends javax.swing.JFrame { public departamentos() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { btncardi = new javax.swing.JButton(); btnpedi = new javax.swing.JButton(); btncui = new javax.swing.JButton(); btntera = new javax.swing.JButton(); btnodon = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel();

description

PROYECTO

Transcript of Proyecto clínica codigo

Page 1: Proyecto clínica codigo

Proyecto clínica

DEPARTAMENTOS:

package formularios;

public class departamentos extends javax.swing.JFrame {

public departamentos() {

initComponents();

}

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

btncardi = new javax.swing.JButton();

btnpedi = new javax.swing.JButton();

btncui = new javax.swing.JButton();

btntera = new javax.swing.JButton();

btnodon = new javax.swing.JButton();

jButton1 = new javax.swing.JButton();

jLabel1 = new javax.swing.JLabel();

Page 2: Proyecto clínica codigo

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

setTitle("Servicios y Departamentos");

setBackground(new java.awt.Color(0, 204, 204));

btncardi.setText("Departamento de Cardiologia");

btncardi.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btncardiActionPerformed(evt);

}

});

btnpedi.setText("Departamento de Pediatria");

btnpedi.setActionCommand("");

btnpedi.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnpediActionPerformed(evt);

}

});

btncui.setText("Departamento de Cuidaddos Intensivos");

btncui.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btncuiActionPerformed(evt);

}

});

Page 3: Proyecto clínica codigo

btntera.setText("Departamento Terapeutico");

btntera.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnteraActionPerformed(evt);

}

});

btnodon.setText("Departamento de Odontologia");

btnodon.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnodonActionPerformed(evt);

}

});

jButton1.setText("Atras");

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

jLabel1.setFont(new java.awt.Font("Verdana", 0, 14)); // NOI18N

jLabel1.setText("Seleccione Departamento");

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

Page 4: Proyecto clínica codigo

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(109, 109, 109)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(btncardi)

.addComponent(btnodon)

.addComponent(jLabel1)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

.addComponent(btntera, javax.swing.GroupLayout.Alignment.LEADING,

javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)

.addComponent(btnpedi, javax.swing.GroupLayout.Alignment.LEADING,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,

Short.MAX_VALUE))))

.addGroup(layout.createSequentialGroup()

.addGap(155, 155, 155)

.addComponent(jButton1))

.addGroup(layout.createSequentialGroup()

.addGap(88, 88, 88)

.addComponent(btncui)))

.addContainerGap(105, Short.MAX_VALUE))

);

Page 5: Proyecto clínica codigo

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(jLabel1)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25,

Short.MAX_VALUE)

.addComponent(btncardi)

.addGap(18, 18, 18)

.addComponent(btnpedi)

.addGap(18, 18, 18)

.addComponent(btntera)

.addGap(18, 18, 18)

.addComponent(btnodon)

.addGap(18, 18, 18)

.addComponent(btncui)

.addGap(18, 18, 18)

.addComponent(jButton1)

.addContainerGap())

);

pack();

}// </editor-fold>

private void btncardiActionPerformed(java.awt.event.ActionEvent evt) {

patologias mipatologias = new patologias();

Page 6: Proyecto clínica codigo

mipatologias.setVisible(true);

dispose();

}

private void btnpediActionPerformed(java.awt.event.ActionEvent evt) {

patologias1 mipatologias1 = new patologias1();

mipatologias1.setVisible(true);

dispose();

}

private void btnodonActionPerformed(java.awt.event.ActionEvent evt) {

patologias2 mipatologias2 = new patologias2();

mipatologias2.setVisible(true);

dispose();

}

private void btnteraActionPerformed(java.awt.event.ActionEvent evt) {

patologias3 mipatologias3 = new patologias3();

mipatologias3.setVisible(true);

dispose();

}

private void btncuiActionPerformed(java.awt.event.ActionEvent evt) {

patologias4 mipatologias4 = new patologias4();

mipatologias4.setVisible(true);

dispose();

Page 7: Proyecto clínica codigo

}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

frmUsuarios mifrmUsuarios = new frmUsuarios();

mifrmUsuarios.setVisible(true);

dispose();

}

FORMULARIO USUARIO

package formularios;

public class frmUsuarios extends javax.swing.JInternalFrame {

public frmUsuarios() {

initComponents();

}

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jLabel1 = new javax.swing.JLabel();

Page 8: Proyecto clínica codigo

txtidusuario = new javax.swing.JTextField();

jLabel2 = new javax.swing.JLabel();

txtNombres = new javax.swing.JTextField();

jLabel3 = new javax.swing.JLabel();

txtApellidos = new javax.swing.JTextField();

jLabel4 = new javax.swing.JLabel();

txtDireccion = new javax.swing.JTextField();

jLabel5 = new javax.swing.JLabel();

txtTelefono = new javax.swing.JTextField();

jLabel9 = new javax.swing.JLabel();

btnGuardar = new javax.swing.JButton();

btnSiguiente = new javax.swing.JButton();

btnNuevo = new javax.swing.JButton();

btnBuscar = new javax.swing.JButton();

btneliminar = new javax.swing.JButton();

btncancelar = new javax.swing.JButton();

combo = new javax.swing.JComboBox();

setBackground(new java.awt.Color(204, 204, 204));

setClosable(true);

setIconifiable(true);

setMaximizable(true);

setResizable(true);

setTitle("Usuarios");

setEnabled(false);

Page 9: Proyecto clínica codigo

jLabel1.setText("ID Usuario:");

txtidusuario.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

txtidusuarioActionPerformed(evt);

}

});

jLabel2.setText("Nombres:");

txtNombres.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

txtNombresActionPerformed(evt);

}

});

jLabel3.setText("Apellidos:");

txtApellidos.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

txtApellidosActionPerformed(evt);

}

});

jLabel4.setText("Dieccion:");

Page 10: Proyecto clínica codigo

txtDireccion.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

txtDireccionActionPerformed(evt);

}

});

jLabel5.setText("Telefono:");

txtTelefono.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

txtTelefonoActionPerformed(evt);

}

});

jLabel9.setText("Genero:");

btnGuardar.setText("Guardar");

btnGuardar.setToolTipText("Guardar");

btnGuardar.setEnabled(false);

btnGuardar.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnGuardarActionPerformed(evt);

}

});

btnSiguiente.setText("Siguiente");

Page 11: Proyecto clínica codigo

btnSiguiente.setToolTipText("Siguiente Ventana");

btnSiguiente.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnSiguienteActionPerformed(evt);

}

});

btnNuevo.setText("Nuevo");

btnNuevo.setToolTipText("Nevo Usuario");

btnNuevo.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnNuevoActionPerformed(evt);

}

});

btnBuscar.setText("Buscar");

btnBuscar.setToolTipText("Buscar Usuario");

btnBuscar.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnBuscarActionPerformed(evt);

}

});

btneliminar.setText("Eliminar");

btneliminar.setToolTipText("Elimina Usuario");

Page 12: Proyecto clínica codigo

btncancelar.setText("Cancelar");

btncancelar.setToolTipText("Cancelar Usuario");

btncancelar.setEnabled(false);

btncancelar.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btncancelarActionPerformed(evt);

}

});

combo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione",

"Masculino", "Femenino" }));

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(34, 34, 34)

.addComponent(btnGuardar)

.addGap(18, 18, 18)

.addComponent(btnSiguiente)

.addGap(18, 18, 18)

.addComponent(btnNuevo)

.addGap(18, 18, 18)

.addComponent(btnBuscar)

.addGap(18, 18, 18)

Page 13: Proyecto clínica codigo

.addComponent(btncancelar)

.addGap(18, 18, 18)

.addComponent(btneliminar)

.addContainerGap(25, Short.MAX_VALUE))

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,

layout.createSequentialGroup()

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addComponent(jLabel1)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(txtidusuario, javax.swing.GroupLayout.PREFERRED_SIZE, 116,

javax.swing.GroupLayout.PREFERRED_SIZE))

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

.addGroup(layout.createSequentialGroup()

.addComponent(jLabel5)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 117,

javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jLabel9)

.addGap(18, 18, 18)

.addComponent(combo, 0, javax.swing.GroupLayout.DEFAULT_SIZE,

Short.MAX_VALUE))

.addGroup(javax.swing.GroupLayout.Alignment.LEADING,

layout.createSequentialGroup()

Page 14: Proyecto clínica codigo

.addComponent(jLabel2)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)

.addComponent(txtNombres, javax.swing.GroupLayout.PREFERRED_SIZE, 117,

javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jLabel3)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(txtApellidos, javax.swing.GroupLayout.PREFERRED_SIZE, 118,

javax.swing.GroupLayout.PREFERRED_SIZE)))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jLabel4)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 123,

javax.swing.GroupLayout.PREFERRED_SIZE)))

.addGap(4, 4, 4))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(20, 20, 20)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(txtidusuario, javax.swing.GroupLayout.PREFERRED_SIZE,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel1))

.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jLabel2)

Page 15: Proyecto clínica codigo

.addComponent(txtNombres, javax.swing.GroupLayout.PREFERRED_SIZE,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel3)

.addComponent(txtApellidos, javax.swing.GroupLayout.PREFERRED_SIZE,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel4)

.addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(27, 27, 27)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel9)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jLabel5)

.addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 3,

javax.swing.GroupLayout.PREFERRED_SIZE)))

.addGap(52, 52, 52)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(btnGuardar)

.addComponent(btnSiguiente)

.addComponent(btnNuevo)

.addComponent(btnBuscar)

Page 16: Proyecto clínica codigo

.addComponent(btneliminar)

.addComponent(btncancelar)))

.addComponent(combo, javax.swing.GroupLayout.PREFERRED_SIZE,

javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addContainerGap(64, Short.MAX_VALUE))

);

pack();

}// </editor-fold>

private void btnNuevoActionPerformed(java.awt.event.ActionEvent evt) {

//Habilita los botones

btnGuardar.setEnabled(true);

btnSiguiente.setEnabled(false);

btnNuevo.setEnabled(false);

btnBuscar.setEnabled(false);

btncancelar.setEnabled(true);

//Habilita los campos

txtidusuario.setEnabled(true);

txtNombres.setEnabled(true);

txtApellidos.setEnabled(true);

txtDireccion.setEnabled(true);

txtTelefono.setEnabled(true);

Page 17: Proyecto clínica codigo

//Limpiar Campos

txtidusuario.setText(" ");

txtNombres.setText(" ");

txtApellidos.setText(" ");

txtDireccion.setText(" ");

txtTelefono.setText(" ");

combo.setSelectedIndex(0);

//Damos foco al Campo ID

txtidusuario.requestFocusInWindow();

}

private void btnGuardarActionPerformed(java.awt.event.ActionEvent evt) {

//Dsabilita los botones

btnGuardar.setEnabled(false);

btnSiguiente.setEnabled(true);

btnNuevo.setEnabled(true);

btnBuscar.setEnabled(true);

btncancelar.setEnabled(false);

//Desabita Campos

txtidusuario.setEnabled(false);

txtNombres.setEnabled(false);

txtApellidos.setEnabled(false);

txtDireccion.setEnabled(false);

Page 18: Proyecto clínica codigo

txtTelefono.setEnabled(false);

combo.setEnabled(false);

}

private void txtidusuarioActionPerformed(java.awt.event.ActionEvent evt) {

this.setFocusTraversalKeysEnabled(true);

}

private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

}

private void btnSiguienteActionPerformed(java.awt.event.ActionEvent evt) {

triage mitriage = new triage();

mitriage.setVisible(true);

dispose();

}

private void txtNombresActionPerformed(java.awt.event.ActionEvent evt) {

}

Page 19: Proyecto clínica codigo

private void txtApellidosActionPerformed(java.awt.event.ActionEvent evt) {

this.setFocusTraversalKeysEnabled(true);

}

private void txtDireccionActionPerformed(java.awt.event.ActionEvent evt) {

this.setFocusTraversalKeysEnabled(true);

}

private void txtTelefonoActionPerformed(java.awt.event.ActionEvent evt) {

this.setFocusTraversalKeysEnabled(true);

}

private void btncancelarActionPerformed(java.awt.event.ActionEvent evt) {

btnGuardar.setEnabled(false);

btnSiguiente.setEnabled(true);

btnNuevo.setEnabled(true);

btnBuscar.setEnabled(true);

btncancelar.setEnabled(false);

//Dsabilita los botones

btnGuardar.setEnabled(false);

btnSiguiente.setEnabled(true);

btnNuevo.setEnabled(true);

btnBuscar.setEnabled(true);

btncancelar.setEnabled(false);

//Desabita Campos

txtidusuario.setEnabled(false);

Page 20: Proyecto clínica codigo

txtNombres.setEnabled(false);

txtApellidos.setEnabled(false);

txtDireccion.setEnabled(false);

txtTelefono.setEnabled(false);

combo.setEnabled(false);

}

// Variables declaration - do not modify

private javax.swing.JButton btnBuscar;

private javax.swing.JButton btnGuardar;

private javax.swing.JButton btnNuevo;

private javax.swing.JButton btnSiguiente;

private javax.swing.JButton btncancelar;

private javax.swing.JButton btneliminar;

private javax.swing.JComboBox combo;

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 jLabel9;

public static javax.swing.JTextField txtApellidos;

public static javax.swing.JTextField txtDireccion;

public static javax.swing.JTextField txtNombres;

public static javax.swing.JTextField txtTelefono;

Page 21: Proyecto clínica codigo

public static javax.swing.JTextField txtidusuario;

// End of variables declaration

private void setLocationRelativeTo(Object object) {

throw new UnsupportedOperationException("Not supported yet."); //To change body of

generated methods, choose Tools | Templates.

}

}