Cliente.java
/**
     * 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.
     */
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.
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")
    private void initComponents() {
        jButton1 = new javax.swing.JButton();
        txtid = new javax.swing.JTextField();
        txtnombre = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        empresa = new javax.swing.JComboBox<>();
        txtproducto = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabladedatos = new javax.swing.JTable();
        jButton2 = new javax.swing.JButton();
        agregar = new javax.swing.JButton();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jButton1.setText("Guardar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 250, -1, -1));
        txtid.setName("txtid"); 
        txtid.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtidActionPerformed(evt);
            }
        });
        getContentPane().add(txtid, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 20, 140, 30));
        getContentPane().add(txtnombre, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 70, 140, 30));
        jLabel1.setText("ID");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, -1, -1));
        jLabel2.setText("Nombre");
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, -1, -1));
        jLabel3.setText("Cliente");
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 10, -1, -1));
        empresa.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Empresa", "Cliente" }));
        getContentPane().add(empresa, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 180, 130, -1));
        getContentPane().add(txtproducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 120, 140, 30));
        jLabel5.setText("Producto");
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 130, -1, -1));
        tabladedatos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(tabladedatos);
        getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 10, -1, -1));
        jButton2.setText("Agregar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 250, -1, -1));
        agregar.setText("agregar");
        agregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                agregarActionPerformed(evt);
            }
        });
        getContentPane().add(agregar, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 250, -1, -1));
        pack();
    }
@ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { jButton1 = new javax . swing . JButton ( ) ; txtid = new javax . swing . JTextField ( ) ; txtnombre = new javax . swing . JTextField ( ) ; jLabel1 = new javax . swing . JLabel ( ) ; jLabel2 = new javax . swing . JLabel ( ) ; jLabel3 = new javax . swing . JLabel ( ) ; empresa = new javax . swing . JComboBox < > ( ) ; txtproducto = new javax . swing . JTextField ( ) ; jLabel5 = new javax . swing . JLabel ( ) ; jScrollPane1 = new javax . swing . JScrollPane ( ) ; tabladedatos = new javax . swing . JTable ( ) ; jButton2 = new javax . swing . JButton ( ) ; agregar = new javax . swing . JButton ( ) ; setDefaultCloseOperation ( javax . swing . WindowConstants . EXIT_ON_CLOSE ) ; getContentPane ( ) . setLayout ( new org . netbeans . lib . awtextra . AbsoluteLayout ( ) ) ; jButton1 . setText ( "Guardar" ) ; jButton1 . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButton1ActionPerformed ( evt ) ; } } ) ; getContentPane ( ) . add ( jButton1 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 150 , 250 , - 1 , - 1 ) ) ; txtid . setName ( "txtid" ) ; txtid . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { txtidActionPerformed ( evt ) ; } } ) ; getContentPane ( ) . add ( txtid , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 90 , 20 , 140 , 30 ) ) ; getContentPane ( ) . add ( txtnombre , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 90 , 70 , 140 , 30 ) ) ; jLabel1 . setText ( "ID" ) ; getContentPane ( ) . add ( jLabel1 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 30 , 40 , - 1 , - 1 ) ) ; jLabel2 . setText ( "Nombre" ) ; getContentPane ( ) . add ( jLabel2 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 20 , 70 , - 1 , - 1 ) ) ; jLabel3 . setText ( "Cliente" ) ; getContentPane ( ) . add ( jLabel3 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 30 , 10 , - 1 , - 1 ) ) ; empresa . setModel ( new javax . swing . DefaultComboBoxModel < > ( new String [ ] { "Empresa" , "Cliente" } ) ) ; getContentPane ( ) . add ( empresa , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 100 , 180 , 130 , - 1 ) ) ; getContentPane ( ) . add ( txtproducto , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 90 , 120 , 140 , 30 ) ) ; jLabel5 . setText ( "Producto" ) ; getContentPane ( ) . add ( jLabel5 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 40 , 130 , - 1 , - 1 ) ) ; tabladedatos . setModel ( new javax . swing . table . DefaultTableModel ( new Object [ ] [ ] { { null , null , null , null } , { null , null , null , null } , { null , null , null , null } , { null , null , null , null } } , new String [ ] { "Title 1" , "Title 2" , "Title 3" , "Title 4" } ) ) ; jScrollPane1 . setViewportView ( tabladedatos ) ; getContentPane ( ) . add ( jScrollPane1 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 300 , 10 , - 1 , - 1 ) ) ; jButton2 . setText ( "Agregar" ) ; jButton2 . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { jButton2ActionPerformed ( evt ) ; } } ) ; getContentPane ( ) . add ( jButton2 , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 70 , 250 , - 1 , - 1 ) ) ; agregar . setText ( "agregar" ) ; agregar . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { agregarActionPerformed ( evt ) ; } } ) ; getContentPane ( ) . add ( agregar , new org . netbeans . lib . awtextra . AbsoluteConstraints ( 230 , 250 , - 1 , - 1 ) ) ; pack ( ) ; }
This method is called from within the constructor to initialize the form.
This method is called from within the constructor to initialize the form .
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // NOI18N