private void jButton3ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton3ActionPerformed
    try {

      if (this.jTextField2.getText().length() > 0) {
        pre.setPregunta(jTextField2.getText());
        pre.setRespuestacorrecta(jTextField3.getText());
        pre.setIdpregunta(Integer.parseInt(jLabel5.getText()));
        String texto = (String) jComboBox1.getSelectedItem();
        String[] parts = texto.split("-");
        String part = parts[0];
        exa.setIdexamen(Integer.parseInt(part));
        pre.setExamen(exa);
        interfaces op;
        op = (interfaces) Naming.lookup("rmi://localhost/persistencia");
        if (op.actualizarPregunta(pre)) {
          JOptionPane.showMessageDialog(null, "Se actualizo correctamente");
          this.jLabel5.setText("");
          this.jTextField2.setText("");
          this.jTextField3.setText("");
        } else {
          JOptionPane.showMessageDialog(null, "Ocurrio un error");
        }
      } else {
        JOptionPane.showMessageDialog(
            null, "Debe buscar primero el centro de trabajo para poder eliminar o actualizar ");
      }
    } catch (NotBoundException ex) {
      Logger.getLogger(PreguntasForm.class.getName()).log(Level.SEVERE, null, ex);
    } catch (MalformedURLException ex) {
      Logger.getLogger(PreguntasForm.class.getName()).log(Level.SEVERE, null, ex);
    } catch (RemoteException ex) {
      Logger.getLogger(PreguntasForm.class.getName()).log(Level.SEVERE, null, ex);
    }
  } // GEN-LAST:event_jButton3ActionPerformed
 private void jButton4ActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton4ActionPerformed
   try {
     if (this.jTextField2.getText().length() > 0) {
       interfaces op;
       op = (interfaces) Naming.lookup("rmi://localhost/persistencia");
       pre.setIdpregunta(Integer.parseInt(jLabel5.getText()));
       if (op.eliminarPregunta(pre)) {
         JOptionPane.showMessageDialog(null, "Se Elimino correctamente");
         this.jLabel5.setText("");
         this.jTextField2.setText("");
         this.jTextField3.setText("");
       } else {
         JOptionPane.showMessageDialog(null, "Ocurrio un error");
       }
     } else {
       JOptionPane.showMessageDialog(
           null, "Debe buscar primero escuela para poder eliminar o actualizar ");
     }
   } catch (NotBoundException | MalformedURLException | RemoteException ex) {
     Logger.getLogger(Centros.class.getName()).log(Level.SEVERE, null, ex);
   }
 } // GEN-LAST:event_jButton4ActionPerformed