public void ConfirmClose(boolean restart) {
    Object[] options = {Data.text("button-close"), Data.text("button-save&close"), Data.text("button-cancel")};
    int n = JOptionPane.showOptionDialog(rootPane, Data.text("quit-confirm"), Data.text("end"),
            JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);

    switch (n) {
      case 0: { //close
        if (restart) {
          Restart();
        }
        Close();
        break;
      }
      case 1: { //save 'n' close
        mSaveSessionActionPerformed(new ActionEvent(mFile, 0, null));
        if (restart) {
          Restart();
        }
        Close();
        break;
      }
      case 2: //cancel
        break;
      default:
        break;
    }
  }