GitHub repository: neoabc0048/Ayuda-Como-Evitar-Que-Un-JFrame-Se-Abra-Varias-Veces
Description: /*  * 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 Formularios;  import java.awt.Dimension; import java.awt.Toolkit; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import javax.swing.ImageIcon; import javax.swing.JOptionPane;  public class IngresoDeClientes extends javax.swing.JFrame {      Connection con;     CallableStatement st;     ResultSet r;  public IngresoDeClientes() {         initComponents();         this.inhabilitar();         //Inicio Del Codigo Para El Icono De Programa         this.setTitle("Formulario Para El Ingreso De Clientes");         Dimension d=Toolkit.getDefaultToolkit().getScreenSize();         this.setSize((int) d.getWidth() , (int) d.getHeight());         setIconImage(new ImageIcon(getClass().getResource("/Imagenes/Iconocrediya.png")).getImage());                  this.setLocationRelativeTo(null);         this.setResizable(true);         this.inhabilitar();         // Fin Del Codigo Para El Icono De Programa                  //Inicio Del Codigo Para La Conexion De Programa         try{         Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");             con=DriverManager.getConnection("jdbc:sqlserver://DIOSTEBENDIGA:1433;databaseName=BFCLIENTES","sa","123456");                         JOptionPane.showMessageDialog(null,"Conexion De Base De Datos Exitosa");         }catch(Exception ex){JOptionPane.showMessageDialog(null, "Error De Conexion Con La Base De Datos", "Error De Comunicacion", JOptionPane.WARNING_MESSAGE);}                  //Fin Del Codigo Para La Conexion De Programa jdbc:sqlserver://DIOSTEBENDIGA:1433;databaseName=BFCLIENTES         // jdbc:sqlserver://DIOSTEBENDIGA:1433;databaseName=BFCLIENTES     } public class View_Principal extends javax.swing.JFrame {     }      public void inhabilitar(){          BTINuevoIngreso.setEnabled(true);          BTIGuardar.setEnabled(false);          BTIModificar.setEnabled(false);          BTIConsultar.setEnabled(false);          BTILimpiar.setEnabled(false);          BTICancelar.setEnabled(false);          BTIMenuPrincipal.setEnabled(true);          //Caja De Texto          JTICliente.setEnabled(false);          JTIIdentificacion.setEnabled(false);          JTIValor.setEnabled(false);          JTICuota.setEnabled(false);          JTIPago.setEnabled(false);          JTIPorcentaje.setEnabled(false);          JTIPago.setEnabled(false);          JTIFechaDeInicio.setEnabled(false);          JTIFechaFinal.setEnabled(false);          JTITelefono.setEnabled(false);          JTIObservaciones.setEnabled(false);      }                     /**      * 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">                               private void initComponents() {          jPanel1 = new javax.swing.JPanel();         jPanel2 = new javax.swing.JPanel();         jLabel2 = new javax.swing.JLabel();         jLabel3 = new javax.swing.JLabel();         jLabel4 = new javax.swing.JLabel();         jLabel5 = new javax.swing.JLabel();         jLabel6 = new javax.swing.JLabel();         jLabel7 = new javax.swing.JLabel();         jLabel8 = new javax.swing.JLabel();         jLabel9 = new javax.swing.JLabel();         jLabel10 = new javax.swing.JLabel();         JTITelefono = new javax.swing.JTextField();         JTIPorcentaje = new javax.swing.JTextField();         JTIValor = new javax.swing.JTextField();         JTIIdentificacion = new javax.swing.JTextField();         JTICliente = new javax.swing.JTextField();         JTIObservaciones = new javax.swing.JTextField();         JTIPago = new javax.swing.JComboBox<>();         JTICuota = new javax.swing.JTextField();         JTIFechaDeInicio = new javax.swing.JTextField();         jLabel11 = new javax.swing.JLabel();         JTIFechaFinal = new javax.swing.JTextField();         jPanel4 = new javax.swing.JPanel();         jScrollPane1 = new javax.swing.JScrollPane();         jTable1 = new javax.swing.JTable();         jPanel6 = new javax.swing.JPanel();         BTINuevoIngreso = new javax.swing.JButton();         BTIGuardar = new javax.swing.JButton();         BTIModificar = new javax.swing.JButton();         BTIConsultar = new javax.swing.JButton();         BTICancelar = new javax.swing.JButton();         BTISalir1 = new javax.swing.JButton();         BTIMenuPrincipal = new javax.swing.JButton();         BTILimpiar = new javax.swing.JButton();         jLabel1 = new javax.swing.JLabel();          setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);         addWindowListener(new java.awt.event.WindowAdapter() {             public void windowClosing(java.awt.event.WindowEvent evt) {                 formWindowClosing(evt);             }         });          jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 204, 255), 2, true));          jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 204, 255), 2, true), "Registro De Cliente", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Times New Roman", 3, 14))); // NOI18N          jLabel2.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel2.setText("Cliente");          jLabel3.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel3.setText("Identificacion");          jLabel4.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel4.setText("Valor Prestado");          jLabel5.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel5.setText("Cuota");          jLabel6.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel6.setText("Porcentaje");          jLabel7.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel7.setText("Pago");          jLabel8.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel8.setText("Fecha De Inicio");          jLabel9.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel9.setText("Telefono");          jLabel10.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel10.setText("Observaciones");          JTITelefono.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 JTITelefonoActionPerformed(evt);             }         });          JTIIdentificacion.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 JTIIdentificacionActionPerformed(evt);             }         });         JTIIdentificacion.addKeyListener(new java.awt.event.KeyAdapter() {             public void keyTyped(java.awt.event.KeyEvent evt) {                 JTIIdentificacionKeyTyped(evt);             }         });          JTICliente.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 JTIClienteActionPerformed(evt);             }         });          JTIPago.setFont(new java.awt.Font("Times New Roman", 2, 14)); // NOI18N         JTIPago.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Diario", "Semanal", "Quincenal", "Mensual" }));         JTIPago.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));          jLabel11.setFont(new java.awt.Font("Times New Roman", 3, 14)); // NOI18N         jLabel11.setText("Fecha Final");          javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);         jPanel2.setLayout(jPanel2Layout);         jPanel2Layout.setHorizontalGroup(             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel2Layout.createSequentialGroup()                 .addContainerGap()                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addGroup(jPanel2Layout.createSequentialGroup()                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                             .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)                             .addComponent(jLabel3))                         .addGap(18, 18, Short.MAX_VALUE)                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                             .addComponent(JTICliente, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)                             .addComponent(JTIIdentificacion, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)))                     .addGroup(jPanel2Layout.createSequentialGroup()                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                             .addComponent(jLabel4)                             .addComponent(jLabel5))                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                             .addComponent(JTIValor, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)                             .addComponent(JTICuota)))                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                             .addComponent(jLabel6)                             .addComponent(jLabel7)                             .addComponent(jLabel8))                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                         .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                             .addComponent(JTIFechaDeInicio)                             .addComponent(JTIPorcentaje, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)                             .addComponent(JTIPago, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))                     .addGroup(jPanel2Layout.createSequentialGroup()                         .addComponent(jLabel11)                         .addGap(54, 54, 54)                         .addComponent(JTIFechaFinal))                     .addGroup(jPanel2Layout.createSequentialGroup()                         .addComponent(jLabel9)                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                         .addComponent(JTITelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))                     .addGroup(jPanel2Layout.createSequentialGroup()                         .addComponent(jLabel10)                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)                         .addComponent(JTIObservaciones, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)))                 .addContainerGap())         );         jPanel2Layout.setVerticalGroup(             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel2Layout.createSequentialGroup()                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                     .addComponent(jLabel2)                     .addComponent(JTICliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                 .addGap(18, 18, 18)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(JTIIdentificacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                     .addComponent(jLabel3))                 .addGap(18, 18, 18)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                     .addComponent(jLabel4)                     .addComponent(JTIValor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(JTICuota, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                     .addComponent(jLabel5))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(JTIPorcentaje, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                     .addComponent(jLabel6))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(JTIPago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                     .addComponent(jLabel7))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(jLabel8)                     .addComponent(JTIFechaDeInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(jLabel11)                     .addComponent(JTIFechaFinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(jLabel9)                     .addComponent(JTITelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(jLabel10)                     .addComponent(JTIObservaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))         );          jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 204, 255), 2, true), "Personal Registrado", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Times New Roman", 3, 14))); // NOI18N          jTable1.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, 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, 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, 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, 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, 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, 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, null}             },             new String [] {                 "Cliente", "Identificacion", "Valor Prestado", "Cuota", "Porcentaje", "Pago", "Fecha", "Telefono", "Observaciones"             }         ));         jScrollPane1.setViewportView(jTable1);          javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);         jPanel4.setLayout(jPanel4Layout);         jPanel4Layout.setHorizontalGroup(             jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel4Layout.createSequentialGroup()                 .addContainerGap()                 .addComponent(jScrollPane1)                 .addContainerGap())         );         jPanel4Layout.setVerticalGroup(             jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel4Layout.createSequentialGroup()                 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)                 .addContainerGap())         );          jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 204, 255), 2, true), "Botones De Accion", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Times New Roman", 3, 14))); // NOI18N          BTINuevoIngreso.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTINuevoIngreso.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Nuevo.png"))); // NOI18N         BTINuevoIngreso.setText("Nuevo");         BTINuevoIngreso.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTINuevoIngreso.setFocusable(false);         BTINuevoIngreso.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTINuevoIngreso.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTINuevoIngreso.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTINuevoIngreso.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTINuevoIngresoActionPerformed(evt);             }         });          BTIGuardar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTIGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Ingresar.png"))); // NOI18N         BTIGuardar.setText("Ingresar");         BTIGuardar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTIGuardar.setFocusable(false);         BTIGuardar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTIGuardar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTIGuardar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTIGuardar.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTIGuardarActionPerformed(evt);             }         });          BTIModificar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTIModificar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Modificar.png"))); // NOI18N         BTIModificar.setText("Modificar");         BTIModificar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTIModificar.setFocusable(false);         BTIModificar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTIModificar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTIModificar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);          BTIConsultar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTIConsultar.setIcon(new javax.swing.ImageIcon("D:\\Software De Programacion\\Iconos\\Botones\\Buscar.png")); // NOI18N         BTIConsultar.setText("Consultar");         BTIConsultar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTIConsultar.setFocusable(false);         BTIConsultar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTIConsultar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTIConsultar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTIConsultar.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTIConsultarActionPerformed(evt);             }         });          BTICancelar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTICancelar.setIcon(new javax.swing.ImageIcon("D:\\Software De Programacion\\Iconos\\Botones\\Cancelar.png")); // NOI18N         BTICancelar.setText("Cancelar");         BTICancelar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTICancelar.setFocusable(false);         BTICancelar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTICancelar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTICancelar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTICancelar.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTICancelarActionPerformed(evt);             }         });          BTISalir1.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTISalir1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/BSalir.png"))); // NOI18N         BTISalir1.setText("Salir");         BTISalir1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTISalir1.setFocusable(false);         BTISalir1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTISalir1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTISalir1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTISalir1.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTISalir1ActionPerformed(evt);             }         });          BTIMenuPrincipal.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTIMenuPrincipal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/BMenuPrincipal.png"))); // NOI18N         BTIMenuPrincipal.setText("Menu");         BTIMenuPrincipal.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));         BTIMenuPrincipal.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTIMenuPrincipal.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTIMenuPrincipal.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTIMenuPrincipal.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTIMenuPrincipalActionPerformed(evt);             }         });          BTILimpiar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N         BTILimpiar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Limpiar.png"))); // NOI18N         BTILimpiar.setText("Limpiar");         BTILimpiar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);         BTILimpiar.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);         BTILimpiar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);         BTILimpiar.addActionListener(new java.awt.event.ActionListener() {             public void actionPerformed(java.awt.event.ActionEvent evt) {                 BTILimpiarActionPerformed(evt);             }         });          javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);         jPanel6.setLayout(jPanel6Layout);         jPanel6Layout.setHorizontalGroup(             jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel6Layout.createSequentialGroup()                 .addGap(14, 14, 14)                 .addComponent(BTINuevoIngreso, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addGap(18, 18, 18)                 .addComponent(BTIGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addGap(18, 18, 18)                 .addComponent(BTIModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addGap(18, 18, 18)                 .addComponent(BTIConsultar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)                 .addComponent(BTILimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addGap(18, 18, 18)                 .addComponent(BTICancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addGap(18, 18, 18)                 .addComponent(BTIMenuPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addGap(18, 18, 18)                 .addComponent(BTISalir1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addContainerGap())         );         jPanel6Layout.setVerticalGroup(             jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel6Layout.createSequentialGroup()                 .addContainerGap()                 .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(BTISalir1)                     .addComponent(BTIMenuPrincipal)                     .addComponent(BTICancelar)                     .addComponent(BTILimpiar)                     .addComponent(BTIConsultar)                     .addComponent(BTIModificar)                     .addComponent(BTIGuardar)                     .addComponent(BTINuevoIngreso))                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))         );          jLabel1.setFont(new java.awt.Font("Times New Roman", 3, 24)); // NOI18N         jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);         jLabel1.setText("Formulario Para El Ingreso De Nuevos Clientes - CREDIYA");         jLabel1.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 204, 255), 2, true), "Sistema De Prestamos CREDIYA", javax.swing.border.TitledBorder.RIGHT, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Times New Roman", 3, 14), new java.awt.Color(0, 204, 255))); // NOI18N         jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);          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()                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)                     .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                     .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                     .addGroup(jPanel1Layout.createSequentialGroup()                         .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                         .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))                 .addContainerGap())         );         jPanel1Layout.setVerticalGroup(             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(jPanel1Layout.createSequentialGroup()                 .addGap(4, 4, 4)                 .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)                     .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                     .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)                 .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                 .addContainerGap())         );          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());         getContentPane().setLayout(layout);         layout.setHorizontalGroup(             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(layout.createSequentialGroup()                 .addContainerGap()                 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)                 .addContainerGap())         );         layout.setVerticalGroup(             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)             .addGroup(layout.createSequentialGroup()                 .addContainerGap()                 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))         );          pack();     }// </editor-fold>                              private void JTITelefonoActionPerformed(java.awt.event.ActionEvent evt) {                                                     // TODO add your handling code here:     }                                                 private void JTIIdentificacionActionPerformed(java.awt.event.ActionEvent evt) {                                                           // TODO add your handling code here:     }                                                       private void JTIClienteActionPerformed(java.awt.event.ActionEvent evt) {                                                    // TODO add your handling code here:      }                                                private void BTINuevoIngresoActionPerformed(java.awt.event.ActionEvent evt) {                                                         // TODO add your handling code here:          BTINuevoIngreso.setEnabled(true);          BTIGuardar.setEnabled(true);          BTIModificar.setEnabled(true);          BTIConsultar.setEnabled(true);          BTILimpiar.setEnabled(true);          BTICancelar.setEnabled(true);          BTIMenuPrincipal.setEnabled(true);          //Caja De Texto          JTICliente.setEnabled(true);          JTIIdentificacion.setEnabled(true);          JTIValor.setEnabled(true);          JTICuota.setEnabled(true);          JTIPorcentaje.setEnabled(true);          JTIPago.setEnabled(true);          JTIFechaDeInicio.setEnabled(true);          JTIFechaFinal.setEnabled(true);          JTITelefono.setEnabled(true);          JTIObservaciones.setEnabled(true);      }                                                     private void BTISalir1ActionPerformed(java.awt.event.ActionEvent evt) {                                                   // TODO add your handling code here:         if (JOptionPane.showConfirmDialog(rootPane, "¿Desea Salir Del Sistema?",                 "Salida Del Sistema", JOptionPane.YES_NO_CANCEL_OPTION) == JOptionPane.YES_OPTION)             System.exit(0);     }                                               private void BTIConsultarActionPerformed(java.awt.event.ActionEvent evt) {                                                      // TODO add your handling code here:         ConsultaDeClientes obj=new ConsultaDeClientes();         obj.setVisible(true);         JOptionPane.showMessageDialog(null, "Formulario Para La Consulta De Clientes");     }                                                  private void BTIGuardarActionPerformed(java.awt.event.ActionEvent evt) {                                                    // TODO add your handling code here:              String Nom=this.JTICliente.getText();             int Ident=Integer.parseInt(this.JTIIdentificacion.getText());             int Val=Integer.parseInt(this.JTIValor.getText());             int Cuo=Integer.parseInt(this.JTIPago.getActionCommand());             int Porc=Integer.parseInt(this.JTIPorcentaje.getText());             String Pag=this.JTIPago.getActionCommand();             String FecI=this.JTIFechaDeInicio.getText();//JTIFechaDeInicio             String FecF=this.JTIFechaFinal.getText();//JTIFechaFinal             String Tel=this.JTITelefono.getText();             String Obs=this.JTIObservaciones.getText();               if (JTICliente.getText().isEmpty())         {                          JOptionPane.showMessageDialog(null, "Por Favor Ingrese El Nombre Del Cliente","Error",JOptionPane.ERROR_MESSAGE);                               }          else if (JTIIdentificacion.getText().isEmpty())         {                              JOptionPane.showMessageDialog(null, "Por Favor Ingrese Numero De Identificacion","Error",JOptionPane.ERROR_MESSAGE);                                  }         else if (JTIValor.getText().isEmpty())         {                 JOptionPane.showMessageDialog(null, "Por Favor Ingrese Valor Del Prestamo","Error",JOptionPane.ERROR_MESSAGE);                          }         else if (JTIPago.getActionCommand().isEmpty())         {                     JOptionPane.showMessageDialog(null, "Por Favor Ingrese El Numero De Cuotas","Error",JOptionPane.ERROR_MESSAGE);         }                                      else if (JTIPorcentaje.getText().isEmpty())         {                              JOptionPane.showMessageDialog(null, "Por Favor Ingrese El Valor Del Porcentaje","Error",JOptionPane.ERROR_MESSAGE);                         }         else if (JTIPago.getActionCommand().isEmpty())         {                              JOptionPane.showMessageDialog(null, "Por Favor Ingrese El Tipo De Pago","Error",JOptionPane.ERROR_MESSAGE);                         }         else if (JTIFechaDeInicio.getText().isEmpty())             {                 JOptionPane.showMessageDialog(null, "Por Favor Ingrese La Fecha Inicial Del Prestamo ","Error",JOptionPane.ERROR_MESSAGE);             }         else if (JTIFechaFinal.getText().isEmpty())             {                 JOptionPane.showMessageDialog(null, "Por Favor Ingrese La Fecha Final Del Prestamo ","Error",JOptionPane.ERROR_MESSAGE);             }         else if (JTITelefono.getText().isEmpty())         {                      JOptionPane.showMessageDialog(null, "Por Favor Ingrese Un Numero Telefonico O Celular","Error",JOptionPane.ERROR_MESSAGE);          }         else if (JTIObservaciones.getText().isEmpty())         {                              JOptionPane.showMessageDialog(null, "Por Favor Ingrese Una Observacion","Error",JOptionPane.ERROR_MESSAGE);              }         else          {                                             try{              st=con.prepareCall("{call Guardar (?,?,?,?,?,?,?,?,??)}");              st.setString(1, Nom);              st.setInt(2, Ident);              st.setInt(3, Val);              st.setInt(4, Cuo);              st.setInt(5, Porc);              st.setString(6, Pag);              st.setString(7, FecI);              st.setString(8, FecF);              st.setString(9, Tel);              st.setString(10, Obs);              int rta=st.executeUpdate();              if(rta==1)                                {                  JOptionPane.showMessageDialog(null, "Datos Ingresados Correctamente");              }       //este es el error que sale osea que no esta mandando para la base de datos               //y en caso como me lo estas describiendome tiene que salir el mensaje este y me sale es el de              }catch (Exception ex){JOptionPane.showMessageDialog(null, "No Se Guardo Correctamente", "Error De Comunicacion", JOptionPane.WARNING_MESSAGE);}                }                                        }                                                                           private void BTIMenuPrincipalActionPerformed(java.awt.event.ActionEvent evt) {                                                          Menu obj=new Menu();         obj.setVisible(true);         JOptionPane.showMessageDialog(null, "Menu Principal CREDIYA");              }                                                      private void BTICancelarActionPerformed(java.awt.event.ActionEvent evt) {                                                     // TODO add your handling code here:         //Codigo De Limpieza         JTICliente.setText("");         JTIIdentificacion.setText("");         JTIValor.setText("");         JTICuota.setActionCommand("");         JTIPorcentaje.setText("");         JTIPago.setActionCommand("");         JTIFechaDeInicio.setText("");         JTIFechaFinal.setText("");         JTITelefono.setText("");         JTIObservaciones.setText("");         //Fin          //Codigo Para Cancelar         BTINuevoIngreso.setEnabled(true);         BTIGuardar.setEnabled(false);         BTIModificar.setEnabled(false);         BTIConsultar.setEnabled(false);         BTILimpiar.setEnabled(false);         BTICancelar.setEnabled(true);         BTIMenuPrincipal.setEnabled(true);                    //Cajas de texto         JTICliente.setEnabled(false);         JTIIdentificacion.setEnabled(false);         JTIValor.setEnabled(false);         JTICuota.setEnabled(false);         JTIPorcentaje.setEnabled(false);         JTIPago.setEnabled(false);         JTIFechaDeInicio.setEnabled(false);         JTIFechaFinal.setEnabled(false);         JTITelefono.setEnabled(false);         JTIObservaciones.setEnabled(false);     }                                                 private void BTILimpiarActionPerformed(java.awt.event.ActionEvent evt) {                                                    // TODO add your handling code here:         JTICliente.setText("");         JTIIdentificacion.setText("");         JTIValor.setText("");         JTICuota.setActionCommand("");         JTIPorcentaje.setText("");         JTIPago.setActionCommand("");         JTIFechaDeInicio.setText("");         JTIFechaFinal.setText("");         JTITelefono.setText("");         JTIObservaciones.setText("");     }                                           //metodo que al cerrar la ventana ejecuta el codigo contenido     //en el cuerpo     private void formWindowClosing(java.awt.event.WindowEvent evt) {                                            // TODO add your handling code here:         //permite asignar un nuevo valor a la variable de control directamente         //sin necesidad de instanciar un objeto de la clase Menu             }                                        private void JTIIdentificacionKeyTyped(java.awt.event.KeyEvent evt) {                                                    // TODO add your handling code here:              }                                                /**      * @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(IngresoDeClientes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);         } catch (InstantiationException ex) {             java.util.logging.Logger.getLogger(IngresoDeClientes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);         } catch (IllegalAccessException ex) {             java.util.logging.Logger.getLogger(IngresoDeClientes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);         } catch (javax.swing.UnsupportedLookAndFeelException ex) {             java.util.logging.Logger.getLogger(IngresoDeClientes.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);         }         //</editor-fold>         //</editor-fold>          /* Create and display the form */         java.awt.EventQueue.invokeLater(new Runnable() {             public void run() {                 new IngresoDeClientes().setVisible(true);             }         });     }      // Variables declaration - do not modify                          private javax.swing.JButton BTICancelar;     private javax.swing.JButton BTIConsultar;     private javax.swing.JButton BTIGuardar;     private javax.swing.JButton BTILimpiar;     private javax.swing.JButton BTIMenuPrincipal;     private javax.swing.JButton BTIModificar;     private javax.swing.JButton BTINuevoIngreso;     private javax.swing.JButton BTISalir1;     private javax.swing.JTextField JTICliente;     private javax.swing.JTextField JTICuota;     private javax.swing.JTextField JTIFechaDeInicio;     private javax.swing.JTextField JTIFechaFinal;     private javax.swing.JTextField JTIIdentificacion;     private javax.swing.JTextField JTIObservaciones;     private javax.swing.JComboBox<String> JTIPago;     private javax.swing.JTextField JTIPorcentaje;     private javax.swing.JTextField JTITelefono;     private javax.swing.JTextField JTIValor;     private javax.swing.JLabel jLabel1;     private javax.swing.JLabel jLabel10;     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.JPanel jPanel1;     private javax.swing.JPanel jPanel2;     private javax.swing.JPanel jPanel4;     private javax.swing.JPanel jPanel6;     private javax.swing.JScrollPane jScrollPane1;     private javax.swing.JTable jTable1;     // End of variables declaration                         private static class DatosDeIngreso {                              private void setCliente(String text) {                      }                           private void setObservaciones(String text) {                      }          private void Almacenar() {                      }          private void setFecha(String Fecha) {                      }          private void setPago(String text) {                      }                            }     }