All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.ui.framework.java.MessageBoxDialog
java.lang.Object
|
+----com.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.
- See Also:
- JOptionPane
-
dispose()
- Disposes the message dialog.
-
showMessageDialog(Component, Object[], String, int, boolean, Object[], Object)
- Displays a message dialog with user-defined options.
-
showMessageDialog(Component, String, String, int)
- Displays a message dialog with an OK button.
-
showMessageDialog(Component, String, String, int, boolean)
- Displays a message dialog with an OK button.
-
showMessageDialog(Component, String, String, int, boolean, Object[], Object)
- Displays a message dialog with user-defined options.
-
showMessageDialog(Component, String, String, int, Object[], Object)
- Displays a message dialog with user-defined options.
-
splitString(String, int)
- Splits a string of text into a vector of strings.
-
splitString(String, int, FontMetrics)
- Splits a string of text into a vector of strings.
showMessageDialog
public static Object showMessageDialog(Component parent,
String msg,
String title,
int type)
- Displays a message dialog with an OK button.
- Parameters:
- 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
.
- Returns:
- the option selected or null if the dialog was closed
showMessageDialog
public static Object showMessageDialog(Component parent,
String msg,
String title,
int type,
boolean showIcon)
- Displays a message dialog with an OK button.
- Parameters:
- 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 window
- Returns:
- the option selected or null if the dialog was closed
showMessageDialog
public static Object showMessageDialog(Component parent,
String msg,
String title,
int type,
Object options[],
Object initial)
- Displays a message dialog with user-defined options.
- Parameters:
- 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.
- Returns:
- the option selected or null if the dialog was closed
showMessageDialog
public 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.
- Parameters:
- 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 window
- options - An array of options. For example,
{"Yes", "No", "Details"}
.
- initial - The initially selected option in the array supplied. Defaults to the first option.
- Returns:
- the option selected or null if the dialog was closed
showMessageDialog
public 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.
- Parameters:
- 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 window
- options - An array of options. For example,
{"Yes", "No", "Details"}
.
- initial - The initially selected option in the array supplied. Defaults to the first option.
- Returns:
- the option selected or null if the dialog was closed
dispose
public static void dispose()
- Disposes the message dialog.
splitString
public static Vector splitString(String str,
int lineLength)
- Splits a string of text into a vector of strings. Uses the
UI's default font to calculate the splits.
- Parameters:
- str - the string to be split
- lineLength - optimal number of characters on a line
- Returns:
- vector containing each line of the split string
splitString
public static Vector splitString(String str,
int lineLength,
FontMetrics fm)
- Splits a string of text into a vector of strings.
- Parameters:
- str - the string to be split
- lineLength - optimal number of characters on a line
- fm - font metrics of the font used to calculate the splits
- Returns:
- vector containing each line of the split string
All Packages Class Hierarchy This Package Previous Next Index