|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.framework.java.MessageBoxDialog
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
Method Summary | |
static void |
dispose()
Disposes the message dialog. |
static java.lang.Object |
showMessageDialog(java.awt.Component parent,
java.lang.Object[] message,
java.lang.String title,
int type,
boolean showIcon,
java.lang.Object[] options,
java.lang.Object initial)
Displays a message dialog with user-defined options. |
static java.lang.Object |
showMessageDialog(java.awt.Component parent,
java.lang.String msg,
java.lang.String title,
int type)
Displays a message dialog with an OK button. |
static java.lang.Object |
showMessageDialog(java.awt.Component parent,
java.lang.String msg,
java.lang.String title,
int type,
boolean showIcon)
Displays a message dialog with an OK button. |
static java.lang.Object |
showMessageDialog(java.awt.Component parent,
java.lang.String msg,
java.lang.String title,
int type,
boolean showIcon,
java.lang.Object[] options,
java.lang.Object initial)
Displays a message dialog with user-defined options. |
static java.lang.Object |
showMessageDialog(java.awt.Component parent,
java.lang.String msg,
java.lang.String title,
int type,
java.lang.Object[] options,
java.lang.Object initial)
Displays a message dialog with user-defined options. |
static java.util.Vector |
splitString(java.lang.String str,
int lineLength)
Splits a string of text into a vector of strings. |
static java.util.Vector |
splitString(java.lang.String str,
int lineLength,
java.awt.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 |
Method Detail |
public static java.lang.Object showMessageDialog(java.awt.Component parent, java.lang.String msg, java.lang.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:
JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE,
JOptionPane.QUESTION_MESSAGE,
or JOptionPane.PLAIN_MESSAGE
.public static java.lang.Object showMessageDialog(java.awt.Component parent, java.lang.String msg, java.lang.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:
JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE,
JOptionPane.QUESTION_MESSAGE,
or JOptionPane.PLAIN_MESSAGE
.showIcon
- Determines whether the icon will be displayed on the dialog windowpublic static java.lang.Object showMessageDialog(java.awt.Component parent, java.lang.String msg, java.lang.String title, int type, java.lang.Object[] options, java.lang.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:
JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE,
JOptionPane.QUESTION_MESSAGE,
or JOptionPane.PLAIN_MESSAGE
.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 java.lang.Object showMessageDialog(java.awt.Component parent, java.lang.String msg, java.lang.String title, int type, boolean showIcon, java.lang.Object[] options, java.lang.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:
JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE,
JOptionPane.QUESTION_MESSAGE,
or JOptionPane.PLAIN_MESSAGE
.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 java.lang.Object showMessageDialog(java.awt.Component parent, java.lang.Object[] message, java.lang.String title, int type, boolean showIcon, java.lang.Object[] options, java.lang.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:
JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE,
JOptionPane.QUESTION_MESSAGE,
or JOptionPane.PLAIN_MESSAGE
.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 java.util.Vector splitString(java.lang.String str, int lineLength)
str
- the string to be splitlineLength
- optimal number of characters on a linepublic static java.util.Vector splitString(java.lang.String str, int lineLength, java.awt.FontMetrics fm)
str
- the string to be splitlineLength
- optimal number of characters on a linefm
- font metrics of the font used to calculate the splits
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |