|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.ui.framework.java.MessageBoxDialog
public class MessageBoxDialog extends Object
A utility class used to display message boxes. MessageBoxDialog
automatically splits long message strings into multiple lines so that the message
box doesn't become too wide. You can display a simple message with an OK button,
or a complex message box with multiple messages and push buttons.
JOptionPane
Modifier and Type | Field and Description |
---|---|
static int |
ERROR
Used to specify an error message. |
static int |
INFORMATION
Used to specify an informational message. |
static int |
PLAIN
Used to specify a plain message. |
static int |
QUESTION
Used to specify a question message. |
static int |
WARNING
Used to specify a warning message. |
Modifier and Type | Method and Description |
---|---|
static void |
dispose()
Disposes the message dialog. |
static void |
listAllWindows(String header)
|
static Object |
showMessageDialog(Component parent,
Object[] message,
String title,
int type,
boolean showIcon,
Object[] options,
Object initial)
Displays a message dialog with user-defined options. |
static Object |
showMessageDialog(Component parent,
String msg,
String title,
int type)
Displays a message dialog with an OK button. |
static Object |
showMessageDialog(Component parent,
String msg,
String title,
int type,
boolean showIcon)
Displays a message dialog with an OK button. |
static Object |
showMessageDialog(Component parent,
String msg,
String title,
int type,
boolean showIcon,
Object[] options,
Object initial)
Displays a message dialog with user-defined options. |
static Object |
showMessageDialog(Component parent,
String msg,
String title,
int type,
Object[] options,
Object initial)
Displays a message dialog with user-defined options. |
static Vector |
splitString(String str,
int lineLength)
Splits a string of text into a vector of strings. |
static Vector |
splitString(String str,
int lineLength,
FontMetrics fm)
Splits a string of text into a vector of strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ERROR
public static final int INFORMATION
public static final int WARNING
public static final int QUESTION
public static final int PLAIN
Method Detail |
---|
public static Object showMessageDialog(Component parent, String msg, String title, int type)
parent
- Determines the Frame
in which the dialog is displayed.
If null, or if the parent component has no Frame
, a default Frame
is used.msg
- Localized message to display.title
- Localized titlebar text.type
- the type of message that is to be displayed:
MessageBoxDialog.ERROR, MessageBoxDialog.INFORMATION, MessageBoxDialog.WARNING,
MessageBoxDialog.QUESTION,
or MessageBoxDialog.PLAIN
.public static Object showMessageDialog(Component parent, String msg, String title, int type, boolean showIcon)
parent
- Determines the Frame
in which the dialog is displayed.
If null, or if the parent component has no Frame
, a default Frame
is used.msg
- Localized message to display.title
- Localized titlebar text.type
- the type of message that is to be displayed:
MessageBoxDialog.ERROR, MessageBoxDialog.INFORMATION, MessageBoxDialog.WARNING,
MessageBoxDialog.QUESTION,
or MessageBoxDialog.PLAIN
.showIcon
- Determines whether the icon will be displayed on the dialog windowpublic static Object showMessageDialog(Component parent, String msg, String title, int type, Object[] options, Object initial)
parent
- Determines the Frame
in which the dialog is displayed.
If null, or if the parent component has no Frame
, a default Frame
is used.msg
- Localized message to display.title
- Localized titlebar text.type
- the type of message that is to be displayed:
MessageBoxDialog.ERROR, MessageBoxDialog.INFORMATION, MessageBoxDialog.WARNING,
MessageBoxDialog.QUESTION,
or MessageBoxDialog.PLAIN
.options
- An array of options. For example, {"Yes", "No", "Details"}
.initial
- The initially selected option in the array supplied. Defaults to the first option.public static Object showMessageDialog(Component parent, String msg, String title, int type, boolean showIcon, Object[] options, Object initial)
parent
- Determines the Frame
in which the dialog is displayed.
If null, or if the parent component has no Frame
, a default Frame
is used.msg
- Localized message to display.title
- Localized titlebar text.type
- the type of message that is to be displayed:
MessageBoxDialog.ERROR, MessageBoxDialog.INFORMATION, MessageBoxDialog.WARNING,
MessageBoxDialog.QUESTION,
or MessageBoxDialog.PLAIN
.showIcon
- Determines whether the icon will be displayed on the dialog windowoptions
- An array of options. For example, {"Yes", "No", "Details"}
.initial
- The initially selected option in the array supplied. Defaults to the first option.public static Object showMessageDialog(Component parent, Object[] message, String title, int type, boolean showIcon, Object[] options, Object initial)
parent
- Determines the Frame
in which the dialog is displayed.
If null, or if the parent component has no Frame
, a default Frame
is used.message
- Localized message to display.title
- Localized titlebar text.type
- the type of message that is to be displayed:
MessageBoxDialog.ERROR, MessageBoxDialog.INFORMATION, MessageBoxDialog.WARNING,
MessageBoxDialog.QUESTION,
or MessageBoxDialog.PLAIN
.showIcon
- Determines whether the icon will be displayed on the dialog windowoptions
- An array of options. For example, {"Yes", "No", "Details"}
.initial
- The initially selected option in the array supplied. Defaults to the first option.public static void dispose()
public static Vector splitString(String str, int lineLength)
str
- the string to be splitlineLength
- optimal number of characters on a linepublic static Vector splitString(String str, int lineLength, FontMetrics fm)
str
- the string to be splitlineLength
- optimal number of characters on a linefm
- font metrics of the font used to calculate the splitspublic static void listAllWindows(String header)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |