javax.swing
Class JOptionPane

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent 
              extended by javax.swing.JOptionPane
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

public class JOptionPane
extends JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
implements Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something. For information about using JOptionPane, see How to Make Dialogs, a section in The Java Tutorial.

While the JOptionPane class may appear complex because of the large number of methods, almost all uses of this class are one-line calls to one of the static showXxxDialog methods shown below:

Method Name Description
showConfirmDialog Asks a confirming question, like yes/no/cancel.
showInputDialog Prompt for some input.
showMessageDialog Tell the user about something that has happened.
showOptionDialog The Grand Unification of the above three.
Each of these methods also comes in a showInternalXXX flavor, which uses an internal frame to hold the dialog box (see JInternalFrame sample code for javax.swing.JInternalFrame definition code for javax.swing.JInternalFrame ). Multiple convenience methods have also been defined -- overloaded versions of the basic methods that use different parameter lists.

All dialogs are modal. Each showXxxDialog method blocks the current thread until the user's interaction is complete.

icon message
input value
option buttons
The basic appearance of one of these dialog boxes is generally similar to the picture at the right, although the various look-and-feels are ultimately responsible for the final result. In particular, the look-and-feels will adjust the layout to accommodate the option pane's ComponentOrientation property.

Parameters:
The parameters to these methods follow consistent patterns:

parentComponent
Defines the Component that is to be the parent of this dialog box. It is used in two ways: the Frame that contains it is used as the Frame parent for the dialog box, and its screen coordinates are used in the placement of the dialog box. In general, the dialog box is placed just below the component. This parameter may be null, in which case a default Frame is used as the parent, and the dialog will be centered on the screen (depending on the L&F).
message
A descriptive message to be placed in the dialog box. In the most common usage, message is just a String or String constant. However, the type of this parameter is actually Object. Its interpretation depends on its type:
Object[]
An array of objects is interpreted as a series of messages (one per object) arranged in a vertical stack. The interpretation is recursive -- each object in the array is interpreted according to its type.
Component
The Component is displayed in the dialog.
Icon
The Icon is wrapped in a JLabel and displayed in the dialog.
others
The object is converted to a String by calling its toString method. The result is wrapped in a JLabel and displayed.
messageType
Defines the style of the message. The Look and Feel manager may lay out the dialog differently depending on this value, and will often provide a default icon. The possible values are:
  • ERROR_MESSAGE
  • INFORMATION_MESSAGE
  • WARNING_MESSAGE
  • QUESTION_MESSAGE
  • PLAIN_MESSAGE
optionType
Defines the set of option buttons that appear at the bottom of the dialog box:
  • DEFAULT_OPTION
  • YES_NO_OPTION
  • YES_NO_CANCEL_OPTION
  • OK_CANCEL_OPTION
You aren't limited to this set of option buttons. You can provide any buttons you want using the options parameter.
options
A more detailed description of the set of option buttons that will appear at the bottom of the dialog box. The usual value for the options parameter is an array of Strings. But the parameter type is an array of Objects. A button is created for each object depending on its type:
Component
The component is added to the button row directly.
Icon
A JButton is created with this as its label.
other
The Object is converted to a string using its toString method and the result is used to label a JButton.
icon
A decorative icon to be placed in the dialog box. A default value for this is determined by the messageType parameter.
title
The title for the dialog box.
initialValue
The default selection (input value).

When the selection is changed, setValue is invoked, which generates a PropertyChangeEvent.

If a JOptionPane has configured to all input setWantsInput the bound property JOptionPane.INPUT_VALUE_PROPERTY can also be listened to, to determine when the user has input or selected a value.

When one of the showXxxDialog methods returns an integer, the possible values are:

Examples:
Show an error dialog that displays the message, 'alert':
JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE);

Show an internal information dialog with the message, 'information':
JOptionPane.showInternalMessageDialog(frame, "information",
      "information", JOptionPane.INFORMATION_MESSAGE);

Show an information panel with the options yes/no and message 'choose one':
JOptionPane.showConfirmDialog(null,
      "choose one", "choose one", JOptionPane.YES_NO_OPTION);

Show an internal information dialog with the options yes/no/cancel and message 'please choose one' and title information:
JOptionPane.showInternalConfirmDialog(frame,
      "please choose one", "information",
      JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);

Show a warning dialog with the options OK, CANCEL, title 'Warning', and message 'Click OK to continue':
Object[] options = { "OK", "CANCEL" };
JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning",
      JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
      null, options, options[0]);

Show a dialog asking the user to type in a String:
String inputValue = JOptionPane.showInputDialog("Please input a value");

Show a dialog asking the user to select a String:
Object[] possibleValues = { "First", "Second", "Third" };
Object selectedValue = JOptionPane.showInputDialog(null,
      "Choose one", "Input",
      JOptionPane.INFORMATION_MESSAGE, null,
      possibleValues, possibleValues[0]);

Direct Use:
To create and use an JOptionPane directly, the standard pattern is roughly as follows:
     JOptionPane pane = new JOptionPane(arguments);
     pane.set.Xxxx(...); // Configure
     JDialog dialog = pane.createDialog(parentComponent, title);
     dialog.show();
     Object selectedValue = pane.getValue();
     if(selectedValue == null)
       return CLOSED_OPTION;
     //If there is not an array of option buttons:
     if(options == null) {
       if(selectedValue instanceof Integer)
          return ((Integer)selectedValue).intValue();
       return CLOSED_OPTION;
     }
     //If there is an array of option buttons:
     for(int counter = 0, maxCounter = options.length;
        counter < maxCounter; counter++) {
        if(options[counter].equals(selectedValue))
        return counter;
     }
     return CLOSED_OPTION;
 

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
JInternalFrame sample code for javax.swing.JInternalFrame definition code for javax.swing.JInternalFrame , Serialized Form

Nested Class Summary
protected  class JOptionPane.AccessibleJOptionPane sample code for javax.swing.JOptionPane.AccessibleJOptionPane definition code for javax.swing.JOptionPane.AccessibleJOptionPane
          This class implements accessibility support for the JOptionPane class.
 
Nested classes/interfaces inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
static int CANCEL_OPTION sample code for javax.swing.JOptionPane.CANCEL_OPTION definition code for javax.swing.JOptionPane.CANCEL_OPTION
          Return value from class method if CANCEL is chosen.
static int CLOSED_OPTION sample code for javax.swing.JOptionPane.CLOSED_OPTION definition code for javax.swing.JOptionPane.CLOSED_OPTION
          Return value from class method if user closes window without selecting anything, more than likely this should be treated as either a CANCEL_OPTION or NO_OPTION.
static int DEFAULT_OPTION sample code for javax.swing.JOptionPane.DEFAULT_OPTION definition code for javax.swing.JOptionPane.DEFAULT_OPTION
          Type used for showConfirmDialog.
static int ERROR_MESSAGE sample code for javax.swing.JOptionPane.ERROR_MESSAGE definition code for javax.swing.JOptionPane.ERROR_MESSAGE
          Used for error messages.
protected  Icon sample code for javax.swing.Icon definition code for javax.swing.Icon icon sample code for javax.swing.JOptionPane.icon definition code for javax.swing.JOptionPane.icon
          Icon used in pane.
static String sample code for java.lang.String definition code for java.lang.String ICON_PROPERTY sample code for javax.swing.JOptionPane.ICON_PROPERTY definition code for javax.swing.JOptionPane.ICON_PROPERTY
          Bound property name for icon.
static int INFORMATION_MESSAGE sample code for javax.swing.JOptionPane.INFORMATION_MESSAGE definition code for javax.swing.JOptionPane.INFORMATION_MESSAGE
          Used for information messages.
static String sample code for java.lang.String definition code for java.lang.String INITIAL_SELECTION_VALUE_PROPERTY sample code for javax.swing.JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY definition code for javax.swing.JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY
          Bound property name for initialSelectionValue.
static String sample code for java.lang.String definition code for java.lang.String INITIAL_VALUE_PROPERTY sample code for javax.swing.JOptionPane.INITIAL_VALUE_PROPERTY definition code for javax.swing.JOptionPane.INITIAL_VALUE_PROPERTY
          Bound property name for initialValue.
protected  Object sample code for java.lang.Object definition code for java.lang.Object initialSelectionValue sample code for javax.swing.JOptionPane.initialSelectionValue definition code for javax.swing.JOptionPane.initialSelectionValue
          Initial value to select in selectionValues.
protected  Object sample code for java.lang.Object definition code for java.lang.Object initialValue sample code for javax.swing.JOptionPane.initialValue definition code for javax.swing.JOptionPane.initialValue
          Value that should be initially selected in options.
static String sample code for java.lang.String definition code for java.lang.String INPUT_VALUE_PROPERTY sample code for javax.swing.JOptionPane.INPUT_VALUE_PROPERTY definition code for javax.swing.JOptionPane.INPUT_VALUE_PROPERTY
          Bound property name for inputValue.
protected  Object sample code for java.lang.Object definition code for java.lang.Object inputValue sample code for javax.swing.JOptionPane.inputValue definition code for javax.swing.JOptionPane.inputValue
          Value the user has input.
protected  Object sample code for java.lang.Object definition code for java.lang.Object message sample code for javax.swing.JOptionPane.message definition code for javax.swing.JOptionPane.message
          Message to display.
static String sample code for java.lang.String definition code for java.lang.String MESSAGE_PROPERTY sample code for javax.swing.JOptionPane.MESSAGE_PROPERTY definition code for javax.swing.JOptionPane.MESSAGE_PROPERTY
          Bound property name for message.
static String sample code for java.lang.String definition code for java.lang.String MESSAGE_TYPE_PROPERTY sample code for javax.swing.JOptionPane.MESSAGE_TYPE_PROPERTY definition code for javax.swing.JOptionPane.MESSAGE_TYPE_PROPERTY
          Bound property name for type.
protected  int messageType sample code for javax.swing.JOptionPane.messageType definition code for javax.swing.JOptionPane.messageType
          Message type.
static int NO_OPTION sample code for javax.swing.JOptionPane.NO_OPTION definition code for javax.swing.JOptionPane.NO_OPTION
          Return value from class method if NO is chosen.
static int OK_CANCEL_OPTION sample code for javax.swing.JOptionPane.OK_CANCEL_OPTION definition code for javax.swing.JOptionPane.OK_CANCEL_OPTION
          Type used for showConfirmDialog.
static int OK_OPTION sample code for javax.swing.JOptionPane.OK_OPTION definition code for javax.swing.JOptionPane.OK_OPTION
          Return value form class method if OK is chosen.
static String sample code for java.lang.String definition code for java.lang.String OPTION_TYPE_PROPERTY sample code for javax.swing.JOptionPane.OPTION_TYPE_PROPERTY definition code for javax.swing.JOptionPane.OPTION_TYPE_PROPERTY
          Bound property name for optionType.
protected  Object sample code for java.lang.Object definition code for java.lang.Object [] options sample code for javax.swing.JOptionPane.options definition code for javax.swing.JOptionPane.options
          Options to display to the user.
static String sample code for java.lang.String definition code for java.lang.String OPTIONS_PROPERTY sample code for javax.swing.JOptionPane.OPTIONS_PROPERTY definition code for javax.swing.JOptionPane.OPTIONS_PROPERTY
          Bound property name for option.
protected  int optionType sample code for javax.swing.JOptionPane.optionType definition code for javax.swing.JOptionPane.optionType
          Option type, one of DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION or OK_CANCEL_OPTION.
static int PLAIN_MESSAGE sample code for javax.swing.JOptionPane.PLAIN_MESSAGE definition code for javax.swing.JOptionPane.PLAIN_MESSAGE
          No icon is used.
static int QUESTION_MESSAGE sample code for javax.swing.JOptionPane.QUESTION_MESSAGE definition code for javax.swing.JOptionPane.QUESTION_MESSAGE
          Used for questions.
static String sample code for java.lang.String definition code for java.lang.String SELECTION_VALUES_PROPERTY sample code for javax.swing.JOptionPane.SELECTION_VALUES_PROPERTY definition code for javax.swing.JOptionPane.SELECTION_VALUES_PROPERTY
          Bound property name for selectionValues.
protected  Object sample code for java.lang.Object definition code for java.lang.Object [] selectionValues sample code for javax.swing.JOptionPane.selectionValues definition code for javax.swing.JOptionPane.selectionValues
          Array of values the user can choose from.
static Object sample code for java.lang.Object definition code for java.lang.Object UNINITIALIZED_VALUE sample code for javax.swing.JOptionPane.UNINITIALIZED_VALUE definition code for javax.swing.JOptionPane.UNINITIALIZED_VALUE
          Indicates that the user has not yet selected a value.
protected  Object sample code for java.lang.Object definition code for java.lang.Object value sample code for javax.swing.JOptionPane.value definition code for javax.swing.JOptionPane.value
          Currently selected value, will be a valid option, or UNINITIALIZED_VALUE or null.
static String sample code for java.lang.String definition code for java.lang.String VALUE_PROPERTY sample code for javax.swing.JOptionPane.VALUE_PROPERTY definition code for javax.swing.JOptionPane.VALUE_PROPERTY
          Bound property name for value.
static String sample code for java.lang.String definition code for java.lang.String WANTS_INPUT_PROPERTY sample code for javax.swing.JOptionPane.WANTS_INPUT_PROPERTY definition code for javax.swing.JOptionPane.WANTS_INPUT_PROPERTY
          Bound property name for wantsInput.
protected  boolean wantsInput sample code for javax.swing.JOptionPane.wantsInput definition code for javax.swing.JOptionPane.wantsInput
          If true, a UI widget will be provided to the user to get input.
static int WARNING_MESSAGE sample code for javax.swing.JOptionPane.WARNING_MESSAGE definition code for javax.swing.JOptionPane.WARNING_MESSAGE
          Used for warning messages.
static int YES_NO_CANCEL_OPTION sample code for javax.swing.JOptionPane.YES_NO_CANCEL_OPTION definition code for javax.swing.JOptionPane.YES_NO_CANCEL_OPTION
          Type used for showConfirmDialog.
static int YES_NO_OPTION sample code for javax.swing.JOptionPane.YES_NO_OPTION definition code for javax.swing.JOptionPane.YES_NO_OPTION
          Type used for showConfirmDialog.
static int YES_OPTION sample code for javax.swing.JOptionPane.YES_OPTION definition code for javax.swing.JOptionPane.YES_OPTION
          Return value from class method if YES is chosen.
 
Fields inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext , listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList , TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY , ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui , UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane() definition code for javax.swing.JOptionPane.JOptionPane() ()
          Creates a JOptionPane with a test message.
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane(java.lang.Object) definition code for javax.swing.JOptionPane.JOptionPane(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Creates a instance of JOptionPane to display a message using the plain-message message type and the default options delivered by the UI.
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int) definition code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int) (Object sample code for java.lang.Object definition code for java.lang.Object  message, int messageType)
          Creates an instance of JOptionPane to display a message with the specified message type and the default options,
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int) definition code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int) (Object sample code for java.lang.Object definition code for java.lang.Object  message, int messageType, int optionType)
          Creates an instance of JOptionPane to display a message with the specified message type and options.
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon) (Object sample code for java.lang.Object definition code for java.lang.Object  message, int messageType, int optionType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
          Creates an instance of JOptionPane to display a message with the specified message type, options, and icon.
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[]) definition code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object  message, int messageType, int optionType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon, Object sample code for java.lang.Object definition code for java.lang.Object [] options)
          Creates an instance of JOptionPane to display a message with the specified message type, icon, and options.
JOptionPane sample code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  message, int messageType, int optionType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon, Object sample code for java.lang.Object definition code for java.lang.Object [] options, Object sample code for java.lang.Object definition code for java.lang.Object  initialValue)
          Creates an instance of JOptionPane to display a message with the specified message type, icon, and options, with the initially-selected option specified.
 
Method Summary
 JDialog sample code for javax.swing.JDialog definition code for javax.swing.JDialog createDialog sample code for javax.swing.JOptionPane.createDialog(java.awt.Component, java.lang.String) definition code for javax.swing.JOptionPane.createDialog(java.awt.Component, java.lang.String) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, String sample code for java.lang.String definition code for java.lang.String  title)
          Creates and returns a new JDialog wrapping this centered on the parentComponent in the parentComponent's frame.
 JInternalFrame sample code for javax.swing.JInternalFrame definition code for javax.swing.JInternalFrame createInternalFrame sample code for javax.swing.JOptionPane.createInternalFrame(java.awt.Component, java.lang.String) definition code for javax.swing.JOptionPane.createInternalFrame(java.awt.Component, java.lang.String) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, String sample code for java.lang.String definition code for java.lang.String  title)
          Creates and returns an instance of JInternalFrame.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.JOptionPane.getAccessibleContext() definition code for javax.swing.JOptionPane.getAccessibleContext() ()
          Returns the AccessibleContext associated with this JOptionPane.
static JDesktopPane sample code for javax.swing.JDesktopPane definition code for javax.swing.JDesktopPane getDesktopPaneForComponent sample code for javax.swing.JOptionPane.getDesktopPaneForComponent(java.awt.Component) definition code for javax.swing.JOptionPane.getDesktopPaneForComponent(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent)
          Returns the specified component's desktop pane.
static Frame sample code for java.awt.Frame definition code for java.awt.Frame getFrameForComponent sample code for javax.swing.JOptionPane.getFrameForComponent(java.awt.Component) definition code for javax.swing.JOptionPane.getFrameForComponent(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent)
          Returns the specified component's Frame.
 Icon sample code for javax.swing.Icon definition code for javax.swing.Icon getIcon sample code for javax.swing.JOptionPane.getIcon() definition code for javax.swing.JOptionPane.getIcon() ()
          Returns the icon this pane displays.
 Object sample code for java.lang.Object definition code for java.lang.Object getInitialSelectionValue sample code for javax.swing.JOptionPane.getInitialSelectionValue() definition code for javax.swing.JOptionPane.getInitialSelectionValue() ()
          Returns the input value that is displayed as initially selected to the user.
 Object sample code for java.lang.Object definition code for java.lang.Object getInitialValue sample code for javax.swing.JOptionPane.getInitialValue() definition code for javax.swing.JOptionPane.getInitialValue() ()
          Returns the initial value.
 Object sample code for java.lang.Object definition code for java.lang.Object getInputValue sample code for javax.swing.JOptionPane.getInputValue() definition code for javax.swing.JOptionPane.getInputValue() ()
          Returns the value the user has input, if wantsInput is true.
 int getMaxCharactersPerLineCount sample code for javax.swing.JOptionPane.getMaxCharactersPerLineCount() definition code for javax.swing.JOptionPane.getMaxCharactersPerLineCount() ()
          Returns the maximum number of characters to place on a line in a message.
 Object sample code for java.lang.Object definition code for java.lang.Object getMessage sample code for javax.swing.JOptionPane.getMessage() definition code for javax.swing.JOptionPane.getMessage() ()
          Returns the message-object this pane displays.
 int getMessageType sample code for javax.swing.JOptionPane.getMessageType() definition code for javax.swing.JOptionPane.getMessageType() ()
          Returns the message type.
 Object sample code for java.lang.Object definition code for java.lang.Object [] getOptions sample code for javax.swing.JOptionPane.getOptions() definition code for javax.swing.JOptionPane.getOptions() ()
          Returns the choices the user can make.
 int getOp