Exemple #1
0
  private void jButtonModifyActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonModifyActionPerformed
    java.awt.Frame parent = Misc.frameFromComponent(this);
    StyleDialog cd = new StyleDialog(this, true);

    // Take the selected connection from the table...
    if (jTableParameters.getSelectedRow() < 0) return;
    Style irc = null;
    try {
      irc = (Style) jTableParameters.getModel().getValueAt(jTableParameters.getSelectedRow(), 0);
    } catch (Exception ex) {
      return;
    }

    if (irc == null) return;

    cd.setStyle(irc);
    cd.setVisible(true);

    if (cd.getDialogResult() == JOptionPane.OK_OPTION) {
      Style sub = cd.getStyle();
      // Now we have an old and a new object.
      // 1. Adjust table...
      try {
        jTableParameters.getModel().setValueAt(sub, jTableParameters.getSelectedRow(), 0);
      } catch (Exception ex) {
        return;
      }
    }
  } // GEN-LAST:event_jButtonModifyActionPerformed
Exemple #2
0
 private void jButtonNewActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonNewActionPerformed
   java.awt.Frame parent = Misc.frameFromComponent(this);
   StyleDialog cd = new StyleDialog(this, true);
   cd.setVisible(true);
 } // GEN-LAST:event_jButtonNewActionPerformed