|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccs.utils.PasswordDialog
public class PasswordDialog
Displays a dialog to let the user type in a password, with it not being
echoed to the screen. This is a utility wrapper around Swing's JOPtionPane.
As such, it shares the window-title bug described in MsgBox
.
MsgBox
Constructor Summary | |
---|---|
PasswordDialog(java.awt.Frame frame,
java.lang.String title,
boolean isConfirm)
Creates a new password dialog, initially invisible. |
|
PasswordDialog(java.awt.Frame frame,
java.lang.String title,
boolean isConfirm,
boolean isThrow)
Creates a new password dialog, initially invisible. |
Method Summary | |
---|---|
java.lang.String |
getResult()
Returns the result: the password if the user selected OK (and both entries matched where confirmation was specified in the constructor), otherwise null. |
void |
show()
Shows the dialog, modally. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PasswordDialog(java.awt.Frame frame, java.lang.String title, boolean isConfirm, boolean isThrow)
frame
- The parent frame of the dialog. May be null.title
- The title of the dialog.isConfirm
- True to make the user enter the same password twice
(e.g. when defining a new password).isThrow
- Throw IllegalArgumentException
for non-matching passwords.
Ignored unless isConfirm
true. If false, a mismatch generates a message
from the dialog, and a null result, as though cancelled.public PasswordDialog(java.awt.Frame frame, java.lang.String title, boolean isConfirm)
isThrow
false.
frame
- The parent frame of the dialog. May be null.title
- The title of the dialog.isConfirm
- True to make the user enter the same password twice
(e.g. when defining a new password).Method Detail |
---|
public void show()
public java.lang.String getResult()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |