private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
        
        int fila = 0;
        fila =  this.jTable1.getSelectedRow();
        nomCat = jTextField1.getText();
        this.tienePadre=this.jRadioButton1;
        this.contProd = this.jRadioButton2;
        String nomPadre = new String();
        
        ControladorCategoria cont = new ControladorCategoria();
        if(this.contProd.isSelected()==true && this.tienePadre.isSelected()==false){
            System.out.println("Error");
            showMessageDialog(null, "Hey, no pueden haber categorias que contengan productos sin padre :( ", "Error",
                                    JOptionPane.ERROR_MESSAGE);
            
            }

        else{
            try{
                if(this.contProd.isSelected()){
                     nomPadre = String.valueOf(this.jTable1.getValueAt(fila, 0));
                     cont.AltaCategoria(nomCat, true,nomPadre );


                }
                else{
                if(this.tienePadre.isSelected()){
                    nomPadre = String.valueOf(this.jTable1.getValueAt(fila, 0));
                    //System.out.println(nomPadre);
                    cont.AltaCategoria(nomCat, false,nomPadre );
                }
                else{ 
                    cont.AltaCategoria(nomCat, false,null );
                }
                }


                this.jRadioButton1.setSelected(false);
                this.jRadioButton2.setSelected(false);
                this.jTextField1.setText("");
                cargarTabla();
                }
            catch(IndexOutOfBoundsException e) {
            System.err.println("IndexOutOfBoundsException: " + e.getMessage());
            showMessageDialog(null, "Falta seleccionar categoria padre ", "Error",
                                    JOptionPane.ERROR_MESSAGE);
            }
        
        }
        
        
        






    }//GEN-LAST:event_jButton1MouseClicked