All Packages Class Hierarchy This Package Previous Next Index
Class multilizer.MOptionPane
java.lang.Object
|
+----multilizer.MOptionPane
- public class MOptionPane
- extends Object
OptionPane works just like the JOptionPane class. The only difference is
that the dialogs it creates are multilingual. JOptionPane contains several
static showXXXXDialog method. The OptionDialog class contains the same methods
but they are not static. To use them you have to first create an OptionDialog
object.
An example
new OptionDialog(testDictionary1).showMessageDialog(this, "Test");
-
translator
- The translator that is used to translate the dialog(s).
-
MOptionPane(Dictionary)
- Creates a option dialog object.
-
showConfirmDialog(Component, Object)
- Brings up a modal dialog with the options Yes, No and Cancel; with the
title, "Select an Option".
-
showConfirmDialog(Component, Object, String, int)
- Brings up a modal dialog where the number of choices is determined
by the
optionType
parameter.
-
showConfirmDialog(Component, Object, String, int, int)
- Brings up a modal dialog where the number of choices is determined
by the
optionType
parameter, where the messageType
parameter determines the icon to display.
-
showConfirmDialog(Component, Object, String, int, int, Icon)
- Brings up a modal dialog with a specified icon, where the number of
choices is determined by the
optionType
parameter.
-
showInputDialog(Component, Object)
- Shows a question-message dialog requesting input from the user parented to
parentComponent
.
-
showInputDialog(Component, Object, String, int)
- Shows a dialog requesting input from the user parented to
parentComponent
with the dialog having the title
title
and message type messageType
.
-
showInputDialog(Component, Object, String, int, Icon, Object[], Object)
- Prompts the user for input in a blocking dialog where the
initial selection, possible selections, and all other options can
be specified.
-
showInputDialog(Object)
- Shows a question-message dialog requesting input from the user.
-
showInternalConfirmDialog(Component, Object)
- Brings up an internal dialog panel with the options Yes, No
and Cancel; with the title, "Select an Option".
-
showInternalConfirmDialog(Component, Object, String, int)
- Brings up a internal dialog panel where the number of choices
is determined by the
optionType
parameter.
-
showInternalConfirmDialog(Component, Object, String, int, int)
- Brings up an internal dialog panel where the number of choices
is determined by the
optionType
parameter, where
the messageType
parameter determines the icon to display.
-
showInternalConfirmDialog(Component, Object, String, int, int, Icon)
- Brings up an internal dialog panel with a specified icon, where
the number of choices is determined by the
optionType
parameter.
-
showInternalInputDialog(Component, Object)
- Shows an internal question-message dialog requesting input from
the user parented to
parentComponent
.
-
showInternalInputDialog(Component, Object, String, int)
- Shows an internal dialog requesting input from the user parented
to
parentComponent
with the dialog having the title
title
and message type messageType
.
-
showInternalInputDialog(Component, Object, String, int, Icon, Object[], Object)
- Prompts the user for input in a blocking internal dialog where
the initial selection, possible selections, and all other
options can be specified.
-
showInternalMessageDialog(Component, Object)
- Brings up an internal confirmation dialog panel.
-
showInternalMessageDialog(Component, Object, String, int)
- Brings up an internal dialog panel that displays a message
using a default icon determined by the messageType parameter.
-
showInternalMessageDialog(Component, Object, String, int, Icon)
- Brings up an internal dialog panel displaying a message,
specifying all parameters.
-
showInternalOptionDialog(Component, Object, String, int, int, Icon, Object[], Object)
- Brings up an internal dialog panel with a specified icon, where
the initial choice is dermined by the
initialValue
parameter and the number of choices is determined by the
optionType
parameter.
-
showMessageDialog(Component, Object)
- Brings up a confirmation dialog -- a modal information-message dialog
titled "Confirm".
-
showMessageDialog(Component, Object, String, int)
- Brings up a dialog that displays a message using a default
icon determined by the messageType parameter.
-
showMessageDialog(Component, Object, String, int, Icon)
- Brings up a dialog displaying a message, specifying all parameters.
-
showOptionDialog(Component, Object, String, int, int, Icon, Object[], Object)
- Brings up a modal dialog with a specified icon, where the initial
choice is dermined by the
initialValue
parameter and
the number of choices is determined by the optionType
parameter.
-
translateDialog(Container)
- Translates the dialog.
translator
protected Translator translator
- The translator that is used to translate the dialog(s).
MOptionPane
public MOptionPane(Dictionary dictionary)
- Creates a option dialog object.
- Parameters:
- dictionary - The dictionary that is used to translate the dialogs(s).
translateDialog
protected void translateDialog(Container dialog)
- Translates the dialog.
- Parameters:
- dictionary - The dialog that need to be translated.
showInputDialog
public String showInputDialog(Object message)
- Shows a question-message dialog requesting input from the user. The
dialog uses the default frame, which usually means it is centered on
the screen.
- Parameters:
- message - the Object to display
showInputDialog
public String showInputDialog(Component parentComponent,
Object message)
- Shows a question-message dialog requesting input from the user parented to
parentComponent
. The dialog is displayed in the Component's
frame, and is usually positioned below the Component.
- Parameters:
- parentComponent - the parent Component for the dialog
- message - the Object to display
showInputDialog
public String showInputDialog(Component parentComponent,
Object message,
String title,
int messageType)
- Shows a dialog requesting input from the user parented to
parentComponent
with the dialog having the title
title
and message type messageType
.
- Parameters:
- parentComponent - the parent Component for the dialog
- message - the Object to display
- title - the String to display in the dialog title bar
- messageType - the type of message that is to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
showInputDialog
public Object showInputDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon,
Object selectionValues[],
Object initialSelectionValue)
- Prompts the user for input in a blocking dialog where the
initial selection, possible selections, and all other options can
be specified. The user will able to choose from
selectionValues
, where null implies the user can input
whatever they wish, usually by means of a JTextField.
initialSelectionValue
is the initial value to prompt
the user with. It is up to the UI to decide how best to represent
the selectionValues
, but usually a JComboBox, JList, or
JTextField will be used.
- Parameters:
- parentComponent - the parent Component for the dialog
- message - the Object to display
- title - the String to display in the dialog title bar
- messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - the Icon image to display
- selectionValues - an array of Objects that gives the possible
selections
- initialSelectionValue - the value used to initialize the input
field
- Returns:
- users input, or null meaning the user canceled the input
showMessageDialog
public void showMessageDialog(Component parentComponent,
Object message)
- Brings up a confirmation dialog -- a modal information-message dialog
titled "Confirm".
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a default Frame is used.
- message - The Object to display
showMessageDialog
public void showMessageDialog(Component parentComponent,
Object message,
String title,
int messageType)
- Brings up a dialog that displays a message using a default
icon determined by the messageType parameter.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
showMessageDialog
public void showMessageDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon)
- Brings up a dialog displaying a message, specifying all parameters.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - an icon to display in the dialog that helps the user
identify the kind of message that is being displayed.
showConfirmDialog
public int showConfirmDialog(Component parentComponent,
Object message)
- Brings up a modal dialog with the options Yes, No and Cancel; with the
title, "Select an Option".
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- Returns:
- an int indicating the option selected by the user
showConfirmDialog
public int showConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType)
- Brings up a modal dialog where the number of choices is determined
by the
optionType
parameter.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- Returns:
- an int indicating the option selected by the user
showConfirmDialog
public int showConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType)
- Brings up a modal dialog where the number of choices is determined
by the
optionType
parameter, where the messageType
parameter determines the icon to display.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- messageType - an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
- Returns:
- an int indicating the option selected by the user
showConfirmDialog
public int showConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon)
- Brings up a modal dialog with a specified icon, where the number of
choices is determined by the
optionType
parameter.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- messageType - an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - the icon to display in the dialog
- Returns:
- an int indicating the option selected by the user
showOptionDialog
public int showOptionDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object options[],
Object initialValue)
- Brings up a modal dialog with a specified icon, where the initial
choice is dermined by the
initialValue
parameter and
the number of choices is determined by the optionType
parameter.
If optionType
is YES_NO_OPTION, or YES_NO_CANCEL_OPTION
and the options
parameter is null, then the options are
supplied by the look and feel.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- messageType - an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - the icon to display in the dialog
- options - an array of objects indicating the possible choices
the user can make. If the objects are components, they
are rendered properly. Non-String objects are
rendered using their
toString
methods.
If this parameter is null, the options are determined
by the look and feel.
- initialValue - the object that represents the default selection
for the dialog
- Returns:
- an int indicating the option chosen by the user,
or CLOSED_OPTION if the user closed the Dialog
showInternalMessageDialog
public void showInternalMessageDialog(Component parentComponent,
Object message)
- Brings up an internal confirmation dialog panel. The dialog
is a modal information-message dialog titled "Message".
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The object to display
showInternalMessageDialog
public void showInternalMessageDialog(Component parentComponent,
Object message,
String title,
int messageType)
- Brings up an internal dialog panel that displays a message
using a default icon determined by the messageType parameter.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
showInternalMessageDialog
public void showInternalMessageDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon)
- Brings up an internal dialog panel displaying a message,
specifying all parameters.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- title - the title string for the dialog
- messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - an icon to display in the dialog that helps the user
identify the kind of message that is being displayed.
showInternalConfirmDialog
public int showInternalConfirmDialog(Component parentComponent,
Object message)
- Brings up an internal dialog panel with the options Yes, No
and Cancel; with the title, "Select an Option".
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The Object to display
- Returns:
- an int indicating the option selected by the user
showInternalConfirmDialog
public int showInternalConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType)
- Brings up a internal dialog panel where the number of choices
is determined by the
optionType
parameter.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the
toString
method.
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- Returns:
- an int indicating the option selected by the user
showInternalConfirmDialog
public int showInternalConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType)
- Brings up an internal dialog panel where the number of choices
is determined by the
optionType
parameter, where
the messageType
parameter determines the icon to display.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the
toString
method.
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- messageType - an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
- Returns:
- an int indicating the option selected by the user
showInternalConfirmDialog
public int showInternalConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon)
- Brings up an internal dialog panel with a specified icon, where
the number of choices is determined by the
optionType
parameter.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the
toString
method.
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- messageType - an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - the icon to display in the dialog
- Returns:
- an int indicating the option selected by the user
showInternalOptionDialog
public int showInternalOptionDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object options[],
Object initialValue)
- Brings up an internal dialog panel with a specified icon, where
the initial choice is dermined by the
initialValue
parameter and the number of choices is determined by the
optionType
parameter.
If optionType
is YES_NO_OPTION, or YES_NO_CANCEL_OPTION
and the options
parameter is null, then the options are
supplied by the look and feel.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
- Parameters:
- parentComponent - Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.
- message - The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the
toString
method.
- title - the title string for the dialog
- optionType - an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
- messageType - an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - the icon to display in the dialog
- options - an array of objects indicating the possible choices
the user can make. If the objects are components, they
are rendered properly. Non-String objects are
rendered using their
toString
methods.
If this parameter is null, the options are determined
by the look and feel.
- initialValue - the object that represents the default selection
for the dialog
- Returns:
- an int indicating the option chosen by the user,
or CLOSED_OPTION if the user closed the Dialog
showInternalInputDialog
public String showInternalInputDialog(Component parentComponent,
Object message)
- Shows an internal question-message dialog requesting input from
the user parented to
parentComponent
. The dialog
is displayed in the Component's frame, and is usually positioned
below the Component.
- Parameters:
- parentComponent - the parent Component for the dialog
- message - the Object to display
showInternalInputDialog
public String showInternalInputDialog(Component parentComponent,
Object message,
String title,
int messageType)
- Shows an internal dialog requesting input from the user parented
to
parentComponent
with the dialog having the title
title
and message type messageType
.
- Parameters:
- parentComponent - the parent Component for the dialog
- message - the Object to display
- title - the String to display in the dialog title bar
- messageType - the type of message that is to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
showInternalInputDialog
public Object showInternalInputDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon,
Object selectionValues[],
Object initialSelectionValue)
- Prompts the user for input in a blocking internal dialog where
the initial selection, possible selections, and all other
options can be specified. The user will able to choose from
selectionValues
, where null implies the user can input
whatever they wish, usually by means of a JTextField.
initialSelectionValue
is the initial value to prompt
the user with. It is up to the UI to decide how best to represent
the selectionValues
, but usually a JComboBox, JList, or
JTextField will be used.
- Parameters:
- parentComponent - the parent Component for the dialog
- message - the Object to display
- title - the String to display in the dialog title bar
- messageType - the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.
- icon - the Icon image to display
- selectionValues - an array of Objects that gives the possible
selections
- initialSelectionValue - the value used to initialize the input
field
- Returns:
- users input, or null meaning the user canceled the input
All Packages Class Hierarchy This Package Previous Next Index