示例#1
0
 private void cbxnivelesActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_cbxnivelesActionPerformed
   try {
     VerDatos();
   } catch (Exception e) {
     JOptionPane.showMessageDialog(rootPane, e.toString());
   }
 } // GEN-LAST:event_cbxnivelesActionPerformed
示例#2
0
 private void formInternalFrameOpened(
     javax.swing.event.InternalFrameEvent evt) { // GEN-FIRST:event_formInternalFrameOpened
   dtm = (DefaultTableModel) jTable1.getModel();
   try {
     CargarComboNiveles();
     VerDatos();
     HabilitarBotones(true, false, false, false);
   } catch (Exception e) {
     JOptionPane.showMessageDialog(rootPane, e.toString());
   }
 } // GEN-LAST:event_formInternalFrameOpened
示例#3
0
 // End of variables declaration//GEN-END:variables
 public void VerDatos() throws ClassNotFoundException, SQLException {
   try {
     int nf = jTable1.getRowCount();
     for (int i = 0; i < nf; i++) {
       dtm.removeRow(0);
     }
     String nivel = cbxniveles.getSelectedItem().toString();
     StringTokenizer guion = new StringTokenizer(nivel, "-");
     int idnivel = Integer.parseInt(guion.nextToken().toString());
     for (ListaMatricula a : ADNMatricula.ListaMatriculas(idnivel)) {
       dtm.addRow(a.DatostoArray());
     }
   } catch (Exception e) {
     JOptionPane.showMessageDialog(rootPane, e.toString());
   }
 }
示例#4
0
  private void btneliminarActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btneliminarActionPerformed

    try {
      Matricula mat = new Matricula();
      mat.setIdmatricula(FIMatricula.idalu);
      boolean elim = ADNMatricula.Eliminar(mat);
      if (elim) {
        JOptionPane.showMessageDialog(rootPane, "Registro eliminado");
        HabilitarBotones(true, false, false, true);
        VerDatos();
      }
    } catch (Exception e) {
      JOptionPane.showMessageDialog(rootPane, e.toString());
    }
  } // GEN-LAST:event_btneliminarActionPerformed
示例#5
0
 private void btnmodificarActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnmodificarActionPerformed
   try {
     modif = true;
     FIMatricula.idmatricula =
         Integer.parseInt(dtm.getValueAt(jTable1.getSelectedRow(), 0).toString());
     FIMatricula.idalu = Integer.parseInt(dtm.getValueAt(jTable1.getSelectedRow(), 1).toString());
     FIMatricula.nomalu = dtm.getValueAt(jTable1.getSelectedRow(), 2).toString();
     FIMatricula.nivel = dtm.getValueAt(jTable1.getSelectedRow(), 3).toString();
     FIMatricula f = new FIMatricula();
     MDI.pfondo.add(f);
     MDI.Centrar(MDI.pfondo, f);
     f.toFront();
     f.setVisible(true);
     HabilitarBotones(true, false, false, true);
   } catch (Exception e) {
     JOptionPane.showMessageDialog(rootPane, e.toString());
   }
 } // GEN-LAST:event_btnmodificarActionPerformed
  /** Create the frame. */
  public GIncidencia() {

    setIconImage(
        Toolkit.getDefaultToolkit()
            .getImage(
                GIncidencia.class.getResource("/javax/swing/plaf/basic/icons/JavaCup16.png")));
    setResizable(false);
    setTitle("  Ingresar Nueva GIncidencia");
    setBounds(100, 100, 887, 575);
    getContentPane().setLayout(null);

    lblMensListado2 = new JLabel("");
    lblMensListado2.setFont(new Font("Tahoma", Font.PLAIN, 13));
    lblMensListado2.setVisible(false);
    lblMensListado2.setBounds(349, 64, 346, 19);
    getContentPane().add(lblMensListado2);

    lblMensListado1 = new JLabel("");
    lblMensListado1.setVisible(false);
    lblMensListado1.setFont(new Font("Tahoma", Font.PLAIN, 13));
    lblMensListado1.setBounds(10, 64, 319, 19);
    getContentPane().add(lblMensListado1);

    panel = new JPanel();
    panel.setVisible(false);
    panel.setBounds(10, 11, 319, 515);
    panel.setBackground(new Color(51, 102, 153));
    panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    getContentPane().add(panel);
    panel.setLayout(null);

    btnListado = new JButton("LISTAR");
    btnListado.setVisible(false);
    btnListado.setBackground(SystemColor.controlShadow);
    btnListado.addActionListener(this);
    btnListado.setIcon(
        new ImageIcon(
            GIncidencia.class.getResource("/com/sun/java/swing/plaf/motif/icons/Warn.gif")));

    Incidencia = new JScrollPane();
    Incidencia.setVisible(false);
    Incidencia.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
    Incidencia.setBounds(339, 103, 522, 388);
    getContentPane().add(Incidencia);

    txtIncidencia = new JTextArea();
    txtIncidencia.setFont(new Font("Arial", Font.PLAIN, 17));
    txtIncidencia.setToolTipText("");
    Incidencia.setViewportView(txtIncidencia);

    btnLimpiar = new JButton("LIMPIAR");
    btnLimpiar.setVisible(false);

    btnBuscar = new JButton("BUSCAR");
    btnBuscar.setVisible(false);

    btnNuevo = new JButton("NUEVO");
    btnNuevo.setVisible(false);
    btnNuevo.setIcon(
        new ImageIcon(
            GIncidencia.class.getResource("/com/sun/java/swing/plaf/windows/icons/File.gif")));
    btnNuevo.setBackground(SystemColor.controlShadow);
    btnNuevo.setBounds(339, 11, 228, 33);
    getContentPane().add(btnNuevo);

    btnNuevo.addActionListener(this);
    btnBuscar.setBackground(SystemColor.controlShadow);
    btnBuscar.setIcon(
        new ImageIcon(
            GIncidencia.class.getResource("/com/sun/java/swing/plaf/windows/icons/Directory.gif")));
    btnBuscar.setBounds(339, 11, 228, 33);
    getContentPane().add(btnBuscar);
    btnBuscar.addActionListener(this);
    btnLimpiar.setIcon(
        new ImageIcon(GIncidencia.class.getResource("/javax/swing/plaf/metal/icons/sortDown.png")));
    btnLimpiar.setBackground(SystemColor.controlShadow);
    btnLimpiar.setBounds(633, 11, 228, 33);
    getContentPane().add(btnLimpiar);
    btnLimpiar.addActionListener(this);

    btnRegistrar = new JButton("REGISTRAR");
    btnRegistrar.setVisible(false);
    btnRegistrar.setIcon(
        new ImageIcon(
            GIncidencia.class.getResource(
                "/com/sun/javafx/webkit/prism/resources/mediaPlayDisabled.png")));
    btnRegistrar.setBackground(SystemColor.controlShadow);
    btnRegistrar.setBounds(339, 55, 522, 37);
    getContentPane().add(btnRegistrar);
    btnRegistrar.addActionListener(this);

    btnModificar = new JButton("MODIFICAR");
    btnModificar.setVisible(false);
    btnModificar.setIcon(
        new ImageIcon(
            GIncidencia.class.getResource(
                "/com/sun/javafx/scene/control/skin/caspian/dialog-more-details.png")));
    btnModificar.setBackground(SystemColor.controlShadow);
    btnModificar.setBounds(339, 55, 522, 37);
    getContentPane().add(btnModificar);
    btnModificar.addActionListener(this);
    btnListado.setBounds(10, 11, 260, 37);
    getContentPane().add(btnListado);

    JSeparator separator = new JSeparator();
    separator.setBounds(10, 111, 299, 7);
    panel.add(separator);

    JSeparator separator_1 = new JSeparator();
    separator_1.setBounds(10, 294, 299, 14);
    panel.add(separator_1);

    JLabel lblNewLabel = new JLabel("CODIGO DE USUARIO:");
    lblNewLabel.setForeground(Color.WHITE);
    lblNewLabel.setBounds(10, 36, 172, 14);
    panel.add(lblNewLabel);

    JLabel lblCodigo = new JLabel("CODIGO DE INCIDENCIA: ");
    lblCodigo.setForeground(Color.WHITE);
    lblCodigo.setBounds(10, 11, 172, 14);
    panel.add(lblCodigo);

    txtCodigo = new JTextField();
    txtCodigo.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtCodigo.setHorizontalAlignment(SwingConstants.RIGHT);
    txtCodigo.setBackground(SystemColor.controlShadow);
    txtCodigo.setEditable(false);
    txtCodigo.setBounds(203, 9, 106, 17);
    panel.add(txtCodigo);
    txtCodigo.setColumns(10);

    txtCodUsu = new JTextField();
    txtCodUsu.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtCodUsu.setHorizontalAlignment(SwingConstants.RIGHT);
    txtCodUsu.setBackground(SystemColor.controlShadow);
    txtCodUsu.setEditable(false);
    txtCodUsu.setColumns(10);
    txtCodUsu.setBounds(203, 34, 106, 17);
    panel.add(txtCodUsu);

    JLabel lblCodigoDeEspecialista = new JLabel("CODIGO DE ESPECIALISTA:");
    lblCodigoDeEspecialista.setForeground(Color.WHITE);
    lblCodigoDeEspecialista.setBounds(10, 61, 172, 14);
    panel.add(lblCodigoDeEspecialista);

    JLabel lblCodigoDeTipo = new JLabel("CODIGO DE TIPO DE INCIDENCIA:");
    lblCodigoDeTipo.setForeground(Color.WHITE);
    lblCodigoDeTipo.setBounds(10, 86, 188, 14);
    panel.add(lblCodigoDeTipo);

    JLabel lblDescripcion = new JLabel("DESCRIPCION:");
    lblDescripcion.setForeground(Color.WHITE);
    lblDescripcion.setBounds(10, 115, 110, 14);
    panel.add(lblDescripcion);

    JLabel lblComentariosObservaciones = new JLabel("COMENTARIOS / OBSERVACIONES:");
    lblComentariosObservaciones.setForeground(Color.WHITE);
    lblComentariosObservaciones.setBounds(10, 198, 188, 28);
    panel.add(lblComentariosObservaciones);

    JLabel lblTiempoEstimadoDe = new JLabel("TIEMPO ESTIMADO DE SOLUCION:");
    lblTiempoEstimadoDe.setForeground(Color.WHITE);
    lblTiempoEstimadoDe.setBounds(10, 309, 203, 14);
    panel.add(lblTiempoEstimadoDe);

    txtTiempoEstimado = new JTextField();
    txtTiempoEstimado.addKeyListener(this);
    txtTiempoEstimado.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtTiempoEstimado.setHorizontalAlignment(SwingConstants.RIGHT);
    txtTiempoEstimado.setColumns(10);
    txtTiempoEstimado.setBounds(215, 306, 94, 17);
    panel.add(txtTiempoEstimado);

    JLabel lblTiempoRealDe = new JLabel("TIEMPO REAL DE SOLUCION:");
    lblTiempoRealDe.setForeground(Color.WHITE);
    lblTiempoRealDe.setBounds(10, 337, 172, 14);
    panel.add(lblTiempoRealDe);

    txtTiempoReal = new JTextField();
    txtTiempoReal.addKeyListener(this);
    txtTiempoReal.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtTiempoReal.setHorizontalAlignment(SwingConstants.RIGHT);
    txtTiempoReal.setColumns(10);
    txtTiempoReal.setBounds(215, 334, 94, 17);
    panel.add(txtTiempoReal);

    JLabel lblFechaDeRegistro = new JLabel("FECHA DE REGISTRO:");
    lblFechaDeRegistro.setForeground(Color.WHITE);
    lblFechaDeRegistro.setBounds(10, 365, 172, 14);
    panel.add(lblFechaDeRegistro);

    txtFecRegistro = new JTextField();
    txtFecRegistro.setFont(new Font("Tahoma", Font.PLAIN, 13));
    txtFecRegistro.setHorizontalAlignment(SwingConstants.RIGHT);
    txtFecRegistro.setBackground(SystemColor.controlShadow);
    txtFecRegistro.setEditable(false);
    txtFecRegistro.setColumns(10);
    txtFecRegistro.setBounds(181, 362, 128, 17);
    panel.add(txtFecRegistro);

    JLabel lblFechaDeInicio = new JLabel("FECHA DE INICIO DE ATENCION:");
    lblFechaDeInicio.setForeground(Color.WHITE);
    lblFechaDeInicio.setBounds(10, 393, 188, 14);
    panel.add(lblFechaDeInicio);

    try {
      MaskFormatter mascara = new MaskFormatter("##-##-####");
      mascara.setPlaceholderCharacter(' ');
      txtFecInicio = new JFormattedTextField(mascara);
      txtFecInicio.setHorizontalAlignment(SwingConstants.RIGHT);
      txtFecInicio.setFont(new Font("Tahoma", Font.PLAIN, 13));
      txtFecInicio.setBounds(215, 390, 100, 17);
      panel.add(txtFecInicio);
    } catch (Exception e) {
      e.printStackTrace();
    }

    JLabel lblFechaDeFin = new JLabel("FECHA FINAL DE ATENCION:");
    lblFechaDeFin.setForeground(Color.WHITE);
    lblFechaDeFin.setBounds(10, 421, 172, 14);
    panel.add(lblFechaDeFin);

    try {
      MaskFormatter mascara = new MaskFormatter("##-##-####");
      mascara.setPlaceholderCharacter(' ');
      txtFecFinal = new JFormattedTextField(mascara);
      txtFecFinal.setHorizontalAlignment(SwingConstants.RIGHT);
      txtFecFinal.setFont(new Font("Tahoma", Font.PLAIN, 13));
      txtFecFinal.setBounds(215, 418, 100, 17);
      panel.add(txtFecFinal);
    } catch (Exception e) {
      e.printStackTrace();
    }

    JLabel lblEstado = new JLabel("ESTADO:");
    lblEstado.setForeground(Color.WHITE);
    lblEstado.setBounds(10, 449, 86, 14);
    panel.add(lblEstado);

    cboEstado = new JComboBox();
    cboEstado.setFont(new Font("Tahoma", Font.PLAIN, 13));
    cboEstado.setBackground(UIManager.getColor("Button.background"));
    cboEstado.setModel(
        new DefaultComboBoxModel(new String[] {"Registrada", "Iniciada", "Cancelada", "Cerrada"}));
    cboEstado.setBounds(137, 446, 172, 20);
    panel.add(cboEstado);

    JScrollPane scrollPane_1 = new JScrollPane();
    scrollPane_1.setBounds(10, 129, 299, 69);
    panel.add(scrollPane_1);

    txtDescripcion = new JTextArea();
    txtDescripcion.addKeyListener(this);
    txtDescripcion.setFont(new Font("Arial", Font.PLAIN, 19));
    scrollPane_1.setViewportView(txtDescripcion);

    JScrollPane scrollPane_2 = new JScrollPane();
    scrollPane_2.setBounds(10, 220, 299, 69);
    panel.add(scrollPane_2);

    txtObservacion = new JTextArea();
    txtObservacion.addKeyListener(this);
    txtObservacion.setFont(new Font("Arial", Font.PLAIN, 19));
    scrollPane_2.setViewportView(txtObservacion);

    cboEspecialista = new JComboBox();
    cboEspecialista.setFont(new Font("Tahoma", Font.PLAIN, 13));
    cboEspecialista.setBounds(203, 58, 106, 20);
    cboEspecialista.addItem("");
    panel.add(cboEspecialista);

    cboTipoInc = new JComboBox();
    cboTipoInc.setFont(new Font("Tahoma", Font.PLAIN, 13));
    cboTipoInc.setBounds(203, 83, 106, 20);
    cboTipoInc.addItem("");
    panel.add(cboTipoInc);

    btnImprimir = new JButton("IMPRIMIR");
    btnImprimir.addActionListener(this);
    btnImprimir.setIcon(
        new ImageIcon(GIncidencia.class.getResource("/sun/print/resources/orientLandscape.png")));
    btnImprimir.setBounds(633, 493, 228, 33);
    getContentPane().add(btnImprimir);

    Listado = new JScrollPane(TablaIncidencias);
    Listado.setVisible(false);
    Listado.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
    JViewport viewport = new JViewport();
    Listado.setRowHeaderView(viewport);
    Listado.setBounds(10, 99, 861, 347);
    getContentPane().add(Listado);

    TablaIncidencias = new JTable();
    TablaIncidencias.setFont(new Font("Tahoma", Font.PLAIN, 13));
    TablaIncidencias.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    Listado.setViewportView(TablaIncidencias);
    columnas();
    tamañoColumnas();

    llenaCampos();
  }