componentWasSaved = true;
  private void save() {    if (!isModified()) {      String[] msg = {        "No modifications were made.",        "Do you want to save anyway?"      };      int answer =        JOptionPane.showConfirmDialog(this, msg,                                      "No Modifications",                                      JOptionPane.YES_NO_OPTION,                                      JOptionPane.WARNING_MESSAGE);      if (answer != JOptionPane.YES_OPTION) return;    }    saveToDatabase(); // force save  }