|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JOptionPane
com.jidesoft.dialog.JideOptionPane
public class JideOptionPane
JideOptionPane
is an enhanced version of JOptionPane.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JOptionPane |
---|
JOptionPane.AccessibleJOptionPane |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
CLOSE_OPTION
A new type for the option pane to have only the close button. |
static String |
DETAILS_PROPERTY
Bound property name for details . |
static String |
TITLE_PROPERTY
Bound property name for title . |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JideOptionPane()
|
|
JideOptionPane(Object message)
|
|
JideOptionPane(Object message,
int messageType)
|
|
JideOptionPane(Object message,
int messageType,
int optionType)
|
|
JideOptionPane(Object message,
int messageType,
int optionType,
Icon icon)
|
|
JideOptionPane(Object message,
int messageType,
int optionType,
Icon icon,
Object[] options)
|
|
JideOptionPane(Object message,
int messageType,
int optionType,
Icon icon,
Object[] options,
Object initialValue)
|
Method Summary | |
---|---|
JDialog |
createDialog(Component parentComponent,
String title)
Creates and returns a new JDialog wrapping
this centered on the parentComponent
in the parentComponent 's frame. |
JDialog |
createDialog(String title)
Creates and returns a new parentless JDialog
with the specified title. |
Object |
getDetails()
Gets the details object. |
static Frame |
getFrameForComponent(Component parentComponent)
Returns the specified component's Frame . |
String |
getResourceString(String key)
Gets the localized string from resource bundle. |
Object |
getTitle()
Gets the title of the option pane. |
protected void |
initComponents()
|
boolean |
isDetailsVisible()
Checks if the details component is visible. |
void |
setDetails(Object details)
Sets the details object. |
void |
setDetailsVisible(boolean visible)
Sets the details component visible. |
void |
setOptionType(int newType)
Overrides the method in JOptionPane to allow a new option - CLOSE_OPTION. |
void |
setTitle(Object title)
Sets the title of the option pane. |
static int |
showConfirmDialog(Component parentComponent,
Object message)
Brings up a dialog with the options Yes, No and Cancel; with the title, Select an Option. |
static int |
showConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType)
Brings up a dialog where the number of choices is determined by the optionType parameter. |
static int |
showConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType)
Brings up a dialog where the number of choices is determined by the optionType parameter, where the
messageType
parameter determines the icon to display. |
static int |
showConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon)
Brings up a dialog with a specified icon, where the number of choices is determined by the optionType parameter. |
static String |
showInputDialog(Component parentComponent,
Object message)
Shows a question-message dialog requesting input from the user parented to parentComponent . |
static String |
showInputDialog(Component parentComponent,
Object message,
Object initialSelectionValue)
Shows a question-message dialog requesting input from the user and parented to parentComponent . |
static 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 . |
static 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. |
static String |
showInputDialog(Object message)
Shows a question-message dialog requesting input from the user. |
static String |
showInputDialog(Object message,
Object initialSelectionValue)
Shows a question-message dialog requesting input from the user, with the input value initialized to initialSelectionValue . |
static void |
showMessageDialog(Component parentComponent,
Object message)
Brings up an information-message dialog titled "Message". |
static 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. |
static void |
showMessageDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon)
Brings up a dialog displaying a message, specifying all parameters. |
static int |
showOptionDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Brings up a dialog with a specified icon, where the initial choice is determined by the initialValue parameter and
the number of choices is determined by the optionType
parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DETAILS_PROPERTY
details
.
public static final String TITLE_PROPERTY
title
.
public static final int CLOSE_OPTION
Constructor Detail |
---|
public JideOptionPane()
public JideOptionPane(Object message)
public JideOptionPane(Object message, int messageType)
public JideOptionPane(Object message, int messageType, int optionType)
public JideOptionPane(Object message, int messageType, int optionType, Icon icon)
public JideOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options)
public JideOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue)
Method Detail |
---|
protected void initComponents()
public void setOptionType(int newType)
setOptionType
in class JOptionPane
newType
- the type of the option pane.public void setDetails(Object details)
details
- the details.public Object getDetails()
public Object getTitle()
public void setTitle(Object title)
title
- the new title of the option pane.public void setDetailsVisible(boolean visible)
visible
- true or false.public String getResourceString(String key)
key
- the resource string key
public boolean isDetailsVisible()
public static String showInputDialog(Object message) throws HeadlessException
message
- the Object
to display
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static String showInputDialog(Object message, Object initialSelectionValue)
initialSelectionValue
. The
dialog uses the default frame, which usually means it is centered on
the screen.
message
- the Object
to displayinitialSelectionValue
- the value used to initialize the input
fieldpublic static String showInputDialog(Component parentComponent, Object message) throws HeadlessException
parentComponent
.
The dialog is displayed on top of the Component
's
frame, and is usually positioned below the Component
.
parentComponent
- the parent Component
for the
dialogmessage
- the Object
to display
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static String showInputDialog(Component parentComponent, Object message, Object initialSelectionValue)
parentComponent
. The input value will be
initialized to initialSelectionValue
.
The dialog is displayed on top of the Component
's
frame, and is usually positioned below the Component
.
parentComponent
- the parent Component
for the
dialogmessage
- the Object
to displayinitialSelectionValue
- the value used to initialize the input
fieldpublic static String showInputDialog(Component parentComponent, Object message, String title, int messageType) throws HeadlessException
parentComponent
with the dialog having the title
title
and message type messageType
.
parentComponent
- the parent Component
for the
dialogmessage
- the Object
to displaytitle
- the String
to display in the dialog
title barmessageType
- the type of message that is to be displayed:
ERROR_MESSAGE
,
INFORMATION_MESSAGE
,
WARNING_MESSAGE
,
QUESTION_MESSAGE
,
or PLAIN_MESSAGE
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static Object showInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue) throws HeadlessException
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.
parentComponent
- the parent Component
for the
dialogmessage
- the Object
to displaytitle
- the String
to display in the
dialog title barmessageType
- the type of message to be displayed:
ERROR_MESSAGE
,
INFORMATION_MESSAGE
,
WARNING_MESSAGE
,
QUESTION_MESSAGE
,
or PLAIN_MESSAGE
icon
- the Icon
image to displayselectionValues
- an array of Object
s that
gives the possible selectionsinitialSelectionValue
- the value used to initialize the input
field
null
meaning the user
canceled the input
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static void showMessageDialog(Component parentComponent, Object message) throws HeadlessException
parentComponent
- determines the Frame
in
which the dialog is displayed; if null
,
or if the parentComponent
has no
Frame
, a default Frame
is usedmessage
- the Object
to display
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType) throws HeadlessException
messageType
parameter.
parentComponent
- determines the Frame
in which the dialog is displayed; if null
,
or if the parentComponent
has no
Frame
, a default Frame
is usedmessage
- the Object
to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed:
ERROR_MESSAGE
,
INFORMATION_MESSAGE
,
WARNING_MESSAGE
,
QUESTION_MESSAGE
,
or PLAIN_MESSAGE
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static void showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon) throws HeadlessException
parentComponent
- determines the Frame
in which the
dialog is displayed; if null
,
or if the parentComponent
has no
Frame
, a
default Frame
is usedmessage
- the Object
to displaytitle
- the title string for the dialogmessageType
- 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
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static int showConfirmDialog(Component parentComponent, Object message) throws HeadlessException
parentComponent
- determines the Frame
in which the
dialog is displayed; if null
,
or if the parentComponent
has no
Frame
, a
default Frame
is usedmessage
- the Object
to display
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType) throws HeadlessException
optionType
parameter.
parentComponent
- determines the Frame
in which the
dialog is displayed; if null
,
or if the parentComponent
has no
Frame
, a
default Frame
is usedmessage
- the Object
to displaytitle
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION
,
YES_NO_CANCEL_OPTION
,
or OK_CANCEL_OPTION
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType) throws HeadlessException
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.
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 displaytitle
- the title string for the dialogoptionType
- an integer designating the options available
on the dialog: YES_NO_OPTION
,
YES_NO_CANCEL_OPTION
,
or OK_CANCEL_OPTION
messageType
- an integer 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
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon) throws HeadlessException
optionType
parameter.
The messageType
parameter is primarily used to supply
a default icon from the look and feel.
parentComponent
- determines the Frame
in which the
dialog is displayed; if null
,
or if the parentComponent
has no
Frame
, a
default Frame
is usedmessage
- the Object to displaytitle
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION
,
YES_NO_CANCEL_OPTION
,
or OK_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
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static int showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue) throws HeadlessException
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.
parentComponent
- determines the Frame
in which the dialog is displayed; if
null
, or if the
parentComponent
has no
Frame
, a
default Frame
is usedmessage
- the Object
to displaytitle
- the title string for the dialogoptionType
- an integer designating the options available on the
dialog: DEFAULT_OPTION
,
YES_NO_OPTION
,
YES_NO_CANCEL_OPTION
,
or OK_CANCEL_OPTION
messageType
- an integer 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 dialogoptions
- 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 FeelinitialValue
- the object that represents the default selection
for the dialog; only meaningful if options
is used; can be null
CLOSED_OPTION
if the user closed
the dialog
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public JDialog createDialog(Component parentComponent, String title) throws HeadlessException
JDialog
wrapping
this
centered on the parentComponent
in the parentComponent
's frame.
title
is the title of the returned dialog.
The returned JDialog
will not be resizable by the
user, however programs can invoke setResizable
on
the JDialog
instance to change this property.
The returned JDialog
will be set up such that
once it is closed, or the user clicks on one of the buttons,
the optionpane's value property will be set accordingly and
the dialog will be closed. Each time the dialog is made visible,
it will reset the option pane's value property to
JOptionPane.UNINITIALIZED_VALUE
to ensure the
user's subsequent action closes the dialog properly.
createDialog
in class JOptionPane
parentComponent
- determines the frame in which the dialog
is displayed; if the parentComponent
has
no Frame
, a default Frame
is usedtitle
- the title string for the dialog
JDialog
containing this instance
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public JDialog createDialog(String title) throws HeadlessException
JDialog
with the specified title.
The returned JDialog
will not be resizable by the
user, however programs can invoke setResizable
on
the JDialog
instance to change this property.
The returned JDialog
will be set up such that
once it is closed, or the user clicks on one of the buttons,
the optionpane's value property will be set accordingly and
the dialog will be closed. Each time the dialog is made visible,
it will reset the option pane's value property to
JOptionPane.UNINITIALIZED_VALUE
to ensure the
user's subsequent action closes the dialog properly.
createDialog
in class JOptionPane
title
- the title string for the dialog
JDialog
containing this instance
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
GraphicsEnvironment.isHeadless()
public static Frame getFrameForComponent(Component parentComponent) throws HeadlessException
Frame
.
parentComponent
- the Component
to check for a
Frame
Frame
that contains the component,
or getRootFrame
if the component is null
,
or does not have a valid Frame
parent
HeadlessException
- if
GraphicsEnvironment.isHeadless
returns
true
JOptionPane.getRootFrame()
,
GraphicsEnvironment.isHeadless()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |