/** The text field for the public key. */
private JTextField publicKeyTextField;
+ /** Whether the dialog was cancelled. */
+ private boolean cancelled;
+
/**
* Creates a new key dialog.
*
//
/**
+ * Returns whether the dialog was cancelled.
+ *
+ * @return {@code true} if the dialog was cancelled, {@code false} otherwise
+ */
+ public boolean wasCancelled() {
+ return cancelled;
+ }
+
+ /**
* Returns the public key.
*
* @return The public key
private void actionOk() {
publicKey = publicKeyTextField.getText();
privateKey = privateKeyTextField.getText();
+ cancelled = false;
setVisible(false);
}
* Quits the dialog, discarding all changes.
*/
private void actionCancel() {
+ cancelled = true;
setVisible(false);
}