示例#1
0
  private void deleteBandActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_deleteBandActionPerformed
    // TODO add your handling code here:
    selectedRow = BandsTable.getSelectedRow();
    band = musicGroupList.get(BandsTable.convertRowIndexToModel(selectedRow));

    int choice =
        JOptionPane.showConfirmDialog(
            null,
            "Θα διαγραφει το επιλεγμένο συγκρότημα " + band.getName() + "!",
            "",
            JOptionPane.OK_CANCEL_OPTION,
            JOptionPane.QUESTION_MESSAGE);

    if (choice == 0) {
      if (DBManager.deleteMusicGroup(band)) {
        musicGroupList.remove(band); // διαγραφη συγκροτηματος
        JOptionPane.showMessageDialog(
            null,
            "Επιτυχής διαγραφή συγκροτήματος!",
            "SUCCESSFUL",
            JOptionPane.INFORMATION_MESSAGE);
      } else {
        JOptionPane.showMessageDialog(
            null, "Αποτυχία διαγραφής συγκροτήματος!", "ERROR", JOptionPane.ERROR_MESSAGE);
      }
    }
  } // GEN-LAST:event_deleteBandActionPerformed
示例#2
0
  private void editBandActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_editBandActionPerformed

    // ανοίγω τη φορμα με τα στοιχεία του επιλεγμενου συγκροήματος
    selectedRow = BandsTable.getSelectedRow();
    band = musicGroupList.get(BandsTable.convertRowIndexToModel(selectedRow));
    new NewOrModifyBand(band).setVisible(true);
    // dispose();
  } // GEN-LAST:event_editBandActionPerformed