|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.swing.ConfirmYNC
public class ConfirmYNC
A confirmation dialog with yes, no, cancel buttons, or just yes and no buttons.
Example:
// Check if we should save current file
// before exiting program.
switch ( ConfirmYNC.confirmYNC( "Do you want to save the file?" ) )
{
// Cancel button pressed -- don't save,
// don't exit.
case ConfirmYNC.CANCEL:
break;
// Yes button pressed -- save then exit.
case ConfirmYNC.YES:
saveTheFile();
exit();
break;
// No button pressed -- just exit.
case ConfirmYNC.NO:
exit();
break;
};
Field Summary | |
---|---|
static int |
CANCEL
Button indices for checking return values. |
static int |
NO
|
static int |
YES
|
Constructor Summary | |
---|---|
ConfirmYNC()
|
Method Summary | |
---|---|
static int |
confirmYN(java.lang.String msg)
Constructs and displays a confirmation dialog with no parent window. |
static int |
confirmYN(java.lang.String msg,
java.awt.Window parent)
Constructs and displays a confirmation alert. |
static int |
confirmYN(StyledString msg)
Constructs and displays a styled text confirmation dialog with no parent window. |
static int |
confirmYN(StyledString msg,
java.awt.Window parent)
Constructs and displays a styled text confirmation alert. |
static int |
confirmYNC(java.lang.String msg)
Constructs and displays a confirmation dialog with no parent window. |
static int |
confirmYNC(java.lang.String msg,
java.awt.Window parent)
Constructs and displays a confirmation alert. |
static int |
confirmYNC(StyledString msg)
Constructs and displays a styled text confirmation dialog with no parent window. |
static int |
confirmYNC(StyledString msg,
java.awt.Window parent)
Constructs and displays a styled text confirmation alert. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CANCEL
public static final int YES
public static final int NO
Constructor Detail |
---|
public ConfirmYNC()
Method Detail |
---|
public static int confirmYNC(java.lang.String msg, java.awt.Window parent)
msg
- The confirmation prompt.parent
- The parent window, or null if none. The dialog
is positioned centered over its parent window
horizontally and positioned with its top
25 pixels below the top of its parent. public static int confirmYNC(java.lang.String msg)
msg
- The confirmation prompt. public static int confirmYN(java.lang.String msg, java.awt.Window parent)
msg
- The confirmation prompt.parent
- The parent window, or null if none. The dialog
is positioned centered over its parent window
horizontally and positioned with its top
25 pixels below the top of its parent. public static int confirmYN(java.lang.String msg)
msg
- The confirmation prompt. public static int confirmYNC(StyledString msg, java.awt.Window parent)
msg
- The confirmation prompt.parent
- The parent window, or null if none. The dialog
is positioned centered over its parent window
horizontally and positioned with its top
25 pixels below the top of its parent. public static int confirmYNC(StyledString msg)
msg
- The confirmation prompt. public static int confirmYN(StyledString msg, java.awt.Window parent)
msg
- The confirmation prompt.parent
- The parent window, or null if none. The dialog
is positioned centered over its parent window
horizontally and positioned with its top
25 pixels below the top of its parent. public static int confirmYN(StyledString msg)
msg
- The confirmation prompt.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |