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 getOptionType sample code for javax.swing.JOptionPane.getOptionType() definition code for javax.swing.JOptionPane.getOptionType() ()
          Returns the type of options that are displayed.
static Frame sample code for java.awt.Frame definition code for java.awt.Frame getRootFrame sample code for javax.swing.JOptionPane.getRootFrame() definition code for javax.swing.JOptionPane.getRootFrame() ()
          Returns the Frame to use for the class methods in which a frame is not provided.
 Object sample code for java.lang.Object definition code for java.lang.Object [] getSelectionValues sample code for javax.swing.JOptionPane.getSelectionValues() definition code for javax.swing.JOptionPane.getSelectionValues() ()
          Returns the input selection values.
 OptionPaneUI sample code for javax.swing.plaf.OptionPaneUI definition code for javax.swing.plaf.OptionPaneUI getUI sample code for javax.swing.JOptionPane.getUI() definition code for javax.swing.JOptionPane.getUI() ()
          Returns the UI object which implements the L&F for this component.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JOptionPane.getUIClassID() definition code for javax.swing.JOptionPane.getUIClassID() ()
          Returns the name of the UI class that implements the L&F for this component.
 Object sample code for java.lang.Object definition code for java.lang.Object getValue sample code for javax.swing.JOptionPane.getValue() definition code for javax.swing.JOptionPane.getValue() ()
          Returns the value the user has selected.
 boolean getWantsInput sample code for javax.swing.JOptionPane.getWantsInput() definition code for javax.swing.JOptionPane.getWantsInput() ()
          Returns the value of the wantsInput property.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JOptionPane.paramString() definition code for javax.swing.JOptionPane.paramString() ()
          Returns a string representation of this JOptionPane.
 void selectInitialValue sample code for javax.swing.JOptionPane.selectInitialValue() definition code for javax.swing.JOptionPane.selectInitialValue() ()
          Requests that the initial value be selected, which will set focus to the initial value.
 void setIcon sample code for javax.swing.JOptionPane.setIcon(javax.swing.Icon) definition code for javax.swing.JOptionPane.setIcon(javax.swing.Icon) (Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  newIcon)
          Sets the icon to display.
 void setInitialSelectionValue sample code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
          Sets the input value that is initially displayed as selected to the user.
 void setInitialValue sample code for javax.swing.JOptionPane.setInitialValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  newInitialValue)
          Sets the initial value that is to be enabled -- the Component that has the focus when the pane is initially displayed.
 void setInputValue sample code for javax.swing.JOptionPane.setInputValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInputValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
          Sets the input value that was selected or input by the user.
 void setMessage sample code for javax.swing.JOptionPane.setMessage(java.lang.Object) definition code for javax.swing.JOptionPane.setMessage(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  newMessage)
          Sets the option pane's message-object.
 void setMessageType sample code for javax.swing.JOptionPane.setMessageType(int) definition code for javax.swing.JOptionPane.setMessageType(int) (int newType)
          Sets the option pane's message type.
 void setOptions sample code for javax.swing.JOptionPane.setOptions(java.lang.Object[]) definition code for javax.swing.JOptionPane.setOptions(java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object [] newOptions)
          Sets the options this pane displays.
 void setOptionType sample code for javax.swing.JOptionPane.setOptionType(int) definition code for javax.swing.JOptionPane.setOptionType(int) (int newType)
          Sets the options to display.
static void setRootFrame sample code for javax.swing.JOptionPane.setRootFrame(java.awt.Frame) definition code for javax.swing.JOptionPane.setRootFrame(java.awt.Frame) (Frame sample code for java.awt.Frame definition code for java.awt.Frame  newRootFrame)
          Sets the frame to use for class methods in which a frame is not provided.
 void setSelectionValues sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) (Object sample code for java.lang.Object definition code for java.lang.Object [] newValues)
          Sets the input selection values for a pane that provides the user with a list of items to choose from.
 void setUI sample code for javax.swing.JOptionPane.setUI(javax.swing.plaf.OptionPaneUI) definition code for javax.swing.JOptionPane.setUI(javax.swing.plaf.OptionPaneUI) (OptionPaneUI sample code for javax.swing.plaf.OptionPaneUI definition code for javax.swing.plaf.OptionPaneUI  ui)
          Sets the UI object which implements the L&F for this component.
 void setValue sample code for javax.swing.JOptionPane.setValue(java.lang.Object) definition code for javax.swing.JOptionPane.setValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
          Sets the value the user has chosen.
 void setWantsInput sample code for javax.swing.JOptionPane.setWantsInput(boolean) definition code for javax.swing.JOptionPane.setWantsInput(boolean) (boolean newValue)
          Sets the wantsInput property.
static int showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Brings up a dialog with the options Yes, No and Cancel; with the title, Select an Option.
static int showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int optionType)
          Brings up a dialog where the number of choices is determined by the optionType parameter.
static int showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.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 sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int optionType, int messageType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
          Brings up a dialog with a specified icon, where the number of choices is determined by the optionType parameter.
static String sample code for java.lang.String definition code for java.lang.String showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Shows a question-message dialog requesting input from the user parented to parentComponent.
static String sample code for java.lang.String definition code for java.lang.String showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, Object sample code for java.lang.Object definition code for java.lang.Object  initialSelectionValue)
          Shows a question-message dialog requesting input from the user and parented to parentComponent.
static String sample code for java.lang.String definition code for java.lang.String showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.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 sample code for java.lang.Object definition code for java.lang.Object showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int messageType, 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 [] selectionValues, Object sample code for java.lang.Object definition code for java.lang.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 sample code for java.lang.String definition code for java.lang.String showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Shows a question-message dialog requesting input from the user.
static String sample code for java.lang.String definition code for java.lang.String showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.lang.Object, java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.lang.Object, java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  message, Object sample code for java.lang.Object definition code for java.lang.Object  initialSelectionValue)
          Shows a question-message dialog requesting input from the user, with the input value initialized to initialSelectionValue.
static int showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Brings up an internal dialog panel with the options Yes, No and Cancel; with the title, Select an Option.
static int showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int optionType)
          Brings up a internal dialog panel where the number of choices is determined by the optionType parameter.
static int showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.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.
static int showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int optionType, int messageType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
          Brings up an internal dialog panel with a specified icon, where the number of choices is determined by the optionType parameter.
static String sample code for java.lang.String definition code for java.lang.String showInternalInputDialog sample code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Shows an internal question-message dialog requesting input from the user parented to parentComponent.
static String sample code for java.lang.String definition code for java.lang.String showInternalInputDialog sample code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.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.
static Object sample code for java.lang.Object definition code for java.lang.Object showInternalInputDialog sample code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int messageType, 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 [] selectionValues, Object sample code for java.lang.Object definition code for java.lang.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.
static void showInternalMessageDialog sample code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Brings up an internal confirmation dialog panel.
static void showInternalMessageDialog sample code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int messageType)
          Brings up an internal dialog panel that displays a message using a default icon determined by the messageType parameter.
static void showInternalMessageDialog sample code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int messageType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
          Brings up an internal dialog panel displaying a message, specifying all parameters.
static int showInternalOptionDialog sample code for javax.swing.JOptionPane.showInternalOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showInternalOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int optionType, int messageType, 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)
          Brings up an internal dialog panel 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.
static void showMessageDialog sample code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message)
          Brings up an information-message dialog titled "Message".
static void showMessageDialog sample code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int messageType)
          Brings up a dialog that displays a message using a default icon determined by the messageType parameter.
static void showMessageDialog sample code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int messageType, Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
          Brings up a dialog displaying a message, specifying all parameters.
static int showOptionDialog sample code for javax.swing.JOptionPane.showOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) (Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent, Object sample code for java.lang.Object definition code for java.lang.Object  message, String sample code for java.lang.String definition code for java.lang.String  title, int optionType, int messageType, 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)
          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.
 void updateUI sample code for javax.swing.JOptionPane.updateUI() definition code for javax.swing.JOptionPane.updateUI() ()
          Notification from the UIManager that the L&F has changed.
 
Methods inherited from class javax.swing.JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() , addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) , contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) , createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() , disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() , enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) , fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) , getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) , getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() , getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() , getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() , getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() , getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() , getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) , getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) , getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) , getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu() , getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) , getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions() , getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() , getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font) , getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics() , getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight() , getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu() , getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap() , getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int) , getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets() , getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets) , getListeners sample code for javax.swing.JComponent.getListeners(java.lang.Class) definition code for javax.swing.JComponent.getListeners(java.lang.Class) , getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point) , getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() , getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() , getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() , getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) , getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() , getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes() , getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane() , getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension) , getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) , getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText() , getToolTipText sample code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) , getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor() , getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler() , getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() , getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() , getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect() , getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth() , getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX() , getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY() , grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus() , isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered() , isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) , isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus() , isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque() , isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled() , isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile() , isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled() , isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() , paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) , paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) , paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int) , paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) , print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) , printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics) , printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics) , printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) , processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) , processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) , processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) , processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) , putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) , registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) , removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) , removeNotify sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify() , removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) , repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int) , repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle) , requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus() , requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean) , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() , requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) , resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions() , reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int) , revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() , scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) , setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) , setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) , setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) , setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) , setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) , setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) , setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) , setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) , setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) , setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean) , setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean) , setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) , setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font) , setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) , setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean) , setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) , setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) , setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) , setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) , setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean) , setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) , setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) , setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) , setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean) , unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) , update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics)
 
Methods inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
add sample code for java.awt.Container.add(java.awt.Component) definition code for java.awt.Container.add(java.awt.Component) , add sample code for java.awt.Container.add(java.awt.Component, int) definition code for java.awt.Container.add(java.awt.Component, int) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) , add sample code for java.awt.Container.add(java.lang.String, java.awt.Component) definition code for java.awt.Container.add(java.lang.String, java.awt.Component) , addContainerListener sample code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) , addImpl sample code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Container.areFocusTraversalKeysSet(int) definition code for java.awt.Container.areFocusTraversalKeysSet(int) , countComponents sample code for java.awt.Container.countComponents() definition code for java.awt.Container.countComponents() , deliverEvent sample code for java.awt.Container.deliverEvent(java.awt.Event) definition code for java.awt.Container.deliverEvent(java.awt.Event) , doLayout sample code for java.awt.Container.doLayout() definition code for java.awt.Container.doLayout() , findComponentAt sample code for java.awt.Container.findComponentAt(int, int) definition code for java.awt.Container.findComponentAt(int, int) , findComponentAt sample code for java.awt.Container.findComponentAt(java.awt.Point) definition code for java.awt.Container.findComponentAt(java.awt.Point) , getComponent sample code for java.awt.Container.getComponent(int) definition code for java.awt.Container.getComponent(int) , getComponentAt sample code for java.awt.Container.getComponentAt(int, int) definition code for java.awt.Container.getComponentAt(int, int) , getComponentAt sample code for java.awt.Container.getComponentAt(java.awt.Point) definition code for java.awt.Container.getComponentAt(java.awt.Point) , getComponentCount sample code for java.awt.Container.getComponentCount() definition code for java.awt.Container.getComponentCount() , getComponents sample code for java.awt.Container.getComponents() definition code for java.awt.Container.getComponents() , getComponentZOrder sample code for java.awt.Container.getComponentZOrder(java.awt.Component) definition code for java.awt.Container.getComponentZOrder(java.awt.Component) , getContainerListeners sample code for java.awt.Container.getContainerListeners() definition code for java.awt.Container.getContainerListeners() , getFocusTraversalKeys sample code for java.awt.Container.getFocusTraversalKeys(int) definition code for java.awt.Container.getFocusTraversalKeys(int) , getFocusTraversalPolicy sample code for java.awt.Container.getFocusTraversalPolicy() definition code for java.awt.Container.getFocusTraversalPolicy() , getLayout sample code for java.awt.Container.getLayout() definition code for java.awt.Container.getLayout() , getMousePosition sample code for java.awt.Container.getMousePosition(boolean) definition code for java.awt.Container.getMousePosition(boolean) , insets sample code for java.awt.Container.insets() definition code for java.awt.Container.insets() , invalidate sample code for java.awt.Container.invalidate() definition code for java.awt.Container.invalidate() , isAncestorOf sample code for java.awt.Container.isAncestorOf(java.awt.Component) definition code for java.awt.Container.isAncestorOf(java.awt.Component) , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot() definition code for java.awt.Container.isFocusCycleRoot() , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Container.isFocusCycleRoot(java.awt.Container) , isFocusTraversalPolicyProvider sample code for java.awt.Container.isFocusTraversalPolicyProvider() definition code for java.awt.Container.isFocusTraversalPolicyProvider() , isFocusTraversalPolicySet sample code for java.awt.Container.isFocusTraversalPolicySet() definition code for java.awt.Container.isFocusTraversalPolicySet() , layout sample code for java.awt.Container.layout() definition code for java.awt.Container.layout() , list sample code for java.awt.Container.list(java.io.PrintStream, int) definition code for java.awt.Container.list(java.io.PrintStream, int) , list sample code for java.awt.Container.list(java.io.PrintWriter, int) definition code for java.awt.Container.list(java.io.PrintWriter, int) , locate sample code for java.awt.Container.locate(int, int) definition code for java.awt.Container.locate(int, int) , minimumSize sample code for java.awt.Container.minimumSize() definition code for java.awt.Container.minimumSize() , paintComponents sample code for java.awt.Container.paintComponents(java.awt.Graphics) definition code for java.awt.Container.paintComponents(java.awt.Graphics) , preferredSize sample code for java.awt.Container.preferredSize() definition code for java.awt.Container.preferredSize() , printComponents sample code for java.awt.Container.printComponents(java.awt.Graphics) definition code for java.awt.Container.printComponents(java.awt.Graphics) , processContainerEvent sample code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) definition code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) , processEvent sample code for java.awt.Container.processEvent(java.awt.AWTEvent) definition code for java.awt.Container.processEvent(java.awt.AWTEvent) , remove sample code for java.awt.Container.remove(java.awt.Component) definition code for java.awt.Container.remove(java.awt.Component) , remove sample code for java.awt.Container.remove(int) definition code for java.awt.Container.remove(int) , removeAll sample code for java.awt.Container.removeAll() definition code for java.awt.Container.removeAll() , removeContainerListener sample code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) , setComponentZOrder sample code for java.awt.Container.setComponentZOrder(java.awt.Component, int) definition code for java.awt.Container.setComponentZOrder(java.awt.Component, int) , setFocusCycleRoot sample code for java.awt.Container.setFocusCycleRoot(boolean) definition code for java.awt.Container.setFocusCycleRoot(boolean) , setFocusTraversalPolicy sample code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) definition code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) , setFocusTraversalPolicyProvider sample code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) definition code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) , setLayout sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , transferFocusBackward sample code for java.awt.Container.transferFocusBackward() definition code for java.awt.Container.transferFocusBackward() , transferFocusDownCycle sample code for java.awt.Container.transferFocusDownCycle() definition code for java.awt.Container.transferFocusDownCycle() , validate sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , validateTree sample code for java.awt.Container.validateTree() definition code for java.awt.Container.validateTree()
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addInputMethodListener sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getInputMethodRequests sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processInputMethodEvent sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setComponentOrientation sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

UNINITIALIZED_VALUE sample code for javax.swing.JOptionPane.UNINITIALIZED_VALUE

public static final Object sample code for java.lang.Object definition code for java.lang.Object  UNINITIALIZED_VALUE
Indicates that the user has not yet selected a value.


DEFAULT_OPTION sample code for javax.swing.JOptionPane.DEFAULT_OPTION

public static final int DEFAULT_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

YES_NO_OPTION sample code for javax.swing.JOptionPane.YES_NO_OPTION

public static final int YES_NO_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

YES_NO_CANCEL_OPTION sample code for javax.swing.JOptionPane.YES_NO_CANCEL_OPTION

public static final int YES_NO_CANCEL_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

OK_CANCEL_OPTION sample code for javax.swing.JOptionPane.OK_CANCEL_OPTION

public static final int OK_CANCEL_OPTION
Type used for showConfirmDialog.

See Also:
Constant Field Values

YES_OPTION sample code for javax.swing.JOptionPane.YES_OPTION

public static final int YES_OPTION
Return value from class method if YES is chosen.

See Also:
Constant Field Values

NO_OPTION sample code for javax.swing.JOptionPane.NO_OPTION

public static final int NO_OPTION
Return value from class method if NO is chosen.

See Also:
Constant Field Values

CANCEL_OPTION sample code for javax.swing.JOptionPane.CANCEL_OPTION

public static final int CANCEL_OPTION
Return value from class method if CANCEL is chosen.

See Also:
Constant Field Values

OK_OPTION sample code for javax.swing.JOptionPane.OK_OPTION

public static final int OK_OPTION
Return value form class method if OK is chosen.

See Also:
Constant Field Values

CLOSED_OPTION sample code for javax.swing.JOptionPane.CLOSED_OPTION

public static final int 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.

See Also:
Constant Field Values

ERROR_MESSAGE sample code for javax.swing.JOptionPane.ERROR_MESSAGE

public static final int ERROR_MESSAGE
Used for error messages.

See Also:
Constant Field Values

INFORMATION_MESSAGE sample code for javax.swing.JOptionPane.INFORMATION_MESSAGE

public static final int INFORMATION_MESSAGE
Used for information messages.

See Also:
Constant Field Values

WARNING_MESSAGE sample code for javax.swing.JOptionPane.WARNING_MESSAGE

public static final int WARNING_MESSAGE
Used for warning messages.

See Also:
Constant Field Values

QUESTION_MESSAGE sample code for javax.swing.JOptionPane.QUESTION_MESSAGE

public static final int QUESTION_MESSAGE
Used for questions.

See Also:
Constant Field Values

PLAIN_MESSAGE sample code for javax.swing.JOptionPane.PLAIN_MESSAGE

public static final int PLAIN_MESSAGE
No icon is used.

See Also:
Constant Field Values

ICON_PROPERTY sample code for javax.swing.JOptionPane.ICON_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  ICON_PROPERTY
Bound property name for icon.

See Also:
Constant Field Values

MESSAGE_PROPERTY sample code for javax.swing.JOptionPane.MESSAGE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  MESSAGE_PROPERTY
Bound property name for message.

See Also:
Constant Field Values

VALUE_PROPERTY sample code for javax.swing.JOptionPane.VALUE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  VALUE_PROPERTY
Bound property name for value.

See Also:
Constant Field Values

OPTIONS_PROPERTY sample code for javax.swing.JOptionPane.OPTIONS_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  OPTIONS_PROPERTY
Bound property name for option.

See Also:
Constant Field Values

INITIAL_VALUE_PROPERTY sample code for javax.swing.JOptionPane.INITIAL_VALUE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  INITIAL_VALUE_PROPERTY
Bound property name for initialValue.

See Also:
Constant Field Values

MESSAGE_TYPE_PROPERTY sample code for javax.swing.JOptionPane.MESSAGE_TYPE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  MESSAGE_TYPE_PROPERTY
Bound property name for type.

See Also:
Constant Field Values

OPTION_TYPE_PROPERTY sample code for javax.swing.JOptionPane.OPTION_TYPE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  OPTION_TYPE_PROPERTY
Bound property name for optionType.

See Also:
Constant Field Values

SELECTION_VALUES_PROPERTY sample code for javax.swing.JOptionPane.SELECTION_VALUES_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  SELECTION_VALUES_PROPERTY
Bound property name for selectionValues.

See Also:
Constant Field Values

INITIAL_SELECTION_VALUE_PROPERTY sample code for javax.swing.JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  INITIAL_SELECTION_VALUE_PROPERTY
Bound property name for initialSelectionValue.

See Also:
Constant Field Values

INPUT_VALUE_PROPERTY sample code for javax.swing.JOptionPane.INPUT_VALUE_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  INPUT_VALUE_PROPERTY
Bound property name for inputValue.

See Also:
Constant Field Values

WANTS_INPUT_PROPERTY sample code for javax.swing.JOptionPane.WANTS_INPUT_PROPERTY

public static final String sample code for java.lang.String definition code for java.lang.String  WANTS_INPUT_PROPERTY
Bound property name for wantsInput.

See Also:
Constant Field Values

icon sample code for javax.swing.JOptionPane.icon

protected transient Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon
Icon used in pane.


message sample code for javax.swing.JOptionPane.message

protected transient Object sample code for java.lang.Object definition code for java.lang.Object  message
Message to display.


options sample code for javax.swing.JOptionPane.options

protected transient Object sample code for java.lang.Object definition code for java.lang.Object [] options
Options to display to the user.


initialValue sample code for javax.swing.JOptionPane.initialValue

protected transient Object sample code for java.lang.Object definition code for java.lang.Object  initialValue
Value that should be initially selected in options.


messageType sample code for javax.swing.JOptionPane.messageType

protected int messageType
Message type.


optionType sample code for javax.swing.JOptionPane.optionType

protected int optionType
Option type, one of DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION or OK_CANCEL_OPTION.


value sample code for javax.swing.JOptionPane.value

protected transient Object sample code for java.lang.Object definition code for java.lang.Object  value
Currently selected value, will be a valid option, or UNINITIALIZED_VALUE or null.


selectionValues sample code for javax.swing.JOptionPane.selectionValues

protected transient Object sample code for java.lang.Object definition code for java.lang.Object [] selectionValues
Array of values the user can choose from. Look and feel will provide the UI component to choose this from.


inputValue sample code for javax.swing.JOptionPane.inputValue

protected transient Object sample code for java.lang.Object definition code for java.lang.Object  inputValue
Value the user has input.


initialSelectionValue sample code for javax.swing.JOptionPane.initialSelectionValue

protected transient Object sample code for java.lang.Object definition code for java.lang.Object  initialSelectionValue
Initial value to select in selectionValues.


wantsInput sample code for javax.swing.JOptionPane.wantsInput

protected boolean wantsInput
If true, a UI widget will be provided to the user to get input.

Constructor Detail

JOptionPane sample code for javax.swing.JOptionPane() definition code for javax.swing.JOptionPane()

public JOptionPane()
Creates a JOptionPane with a test message.


JOptionPane sample code for javax.swing.JOptionPane(java.lang.Object) definition code for javax.swing.JOptionPane(java.lang.Object)

public JOptionPane(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.

Parameters:
message - the Object to display

JOptionPane sample code for javax.swing.JOptionPane(java.lang.Object, int) definition code for javax.swing.JOptionPane(java.lang.Object, int)

public JOptionPane(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,

Parameters:
message - the Object to display
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE

JOptionPane sample code for javax.swing.JOptionPane(java.lang.Object, int, int) definition code for javax.swing.JOptionPane(java.lang.Object, int, int)

public JOptionPane(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.

Parameters:
message - the Object to display
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
optionType - the options to display in the pane: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, OK_CANCEL_OPTION

JOptionPane sample code for javax.swing.JOptionPane(java.lang.Object, int, int, javax.swing.Icon) definition code for javax.swing.JOptionPane(java.lang.Object, int, int, javax.swing.Icon)

public JOptionPane(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.

Parameters:
message - the Object to display
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
optionType - the options to display in the pane: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, OK_CANCEL_OPTION
icon - the Icon image to display

JOptionPane sample code for javax.swing.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[]) definition code for javax.swing.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[])

public JOptionPane(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. None of the options is initially selected.

The options objects should contain either instances of Components, (which are added directly) or Strings (which are wrapped in a JButton). If you provide Components, you must ensure that when the Component is clicked it messages setValue in the created JOptionPane.

Parameters:
message - the Object to display
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
optionType - the options to display in the pane: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, OK_CANCEL_OPTION
icon - the Icon image to display
options - the choices the user can select

JOptionPane sample code for javax.swing.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane(java.lang.Object, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)

public JOptionPane(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.

Parameters:
message - the Object to display
messageType - the type of message to be displayed: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
optionType - the options to display in the pane: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, OK_CANCEL_OPTION
icon - the Icon image to display
options - the choices the user can select
initialValue - the choice that is initially selected; if null, then nothing will be initially selected; only meaningful if options is used
Method Detail

showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.lang.Object)

public static String sample code for java.lang.String definition code for java.lang.String  showInputDialog(Object sample code for java.lang.Object definition code for java.lang.Object  message)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.lang.Object, java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.lang.Object, java.lang.Object)

public static String sample code for java.lang.String definition code for java.lang.String  showInputDialog(Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  initialSelectionValue)
Shows a question-message dialog requesting input from the user, with the input value initialized to initialSelectionValue. The dialog uses the default frame, which usually means it is centered on the screen.

Parameters:
message - the Object to display
initialSelectionValue - the value used to initialize the input field
Since:
1.4

showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object)

public static String sample code for java.lang.String definition code for java.lang.String  showInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Shows a question-message dialog requesting input from the user parented to parentComponent. The dialog is displayed on top of the Component's frame, and is usually positioned below the Component.

Parameters:
parentComponent - the parent Component for the dialog
message - the Object to display
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.Object)

public static String sample code for java.lang.String definition code for java.lang.String  showInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  initialSelectionValue)
Shows a question-message dialog requesting input from the user and parented to 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.

Parameters:
parentComponent - the parent Component for the dialog
message - the Object to display
initialSelectionValue - the value used to initialize the input field
Since:
1.4

showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

public static String sample code for java.lang.String definition code for java.lang.String  showInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                     String sample code for java.lang.String definition code for java.lang.String  title,
                                     int messageType)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showInputDialog sample code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)

public static Object sample code for java.lang.Object definition code for java.lang.Object  showInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                     String sample code for java.lang.String definition code for java.lang.String  title,
                                     int messageType,
                                     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 [] selectionValues,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  initialSelectionValue)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
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:
user's input, or null meaning the user canceled the input
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showMessageDialog sample code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object)

public static void showMessageDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Brings up an 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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showMessageDialog sample code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

public static void showMessageDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                     String sample code for java.lang.String definition code for java.lang.String  title,
                                     int messageType)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showMessageDialog sample code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon)

public static void showMessageDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                     String sample code for java.lang.String definition code for java.lang.String  title,
                                     int messageType,
                                     Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
                              throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object)

public static int showConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                    Object sample code for java.lang.Object definition code for java.lang.Object  message)
                             throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Brings up a 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 integer indicating the option selected by the user
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

public static int showConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                    Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                    String sample code for java.lang.String definition code for java.lang.String  title,
                                    int optionType)
                             throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Brings up a 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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int)

public static int showConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                    Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                    String sample code for java.lang.String definition code for java.lang.String  title,
                                    int optionType,
                                    int messageType)
                             throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Brings up a 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 integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_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
Returns:
an integer indicating the option selected by the user
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showConfirmDialog sample code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon)

public static int showConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                    Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                    String sample code for java.lang.String definition code for java.lang.String  title,
                                    int optionType,
                                    int messageType,
                                    Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  icon)
                             throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Brings up a 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
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showOptionDialog sample code for javax.swing.JOptionPane.showOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)

public static int showOptionDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                   Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                   String sample code for java.lang.String definition code for java.lang.String  title,
                                   int optionType,
                                   int messageType,
                                   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)
                            throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
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.

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 integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_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 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; only meaningful if options is used; can be null
Returns:
an integer indicating the option chosen by the user, or CLOSED_OPTION if the user closed the dialog
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

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)

public JDialog sample code for javax.swing.JDialog definition code for javax.swing.JDialog  createDialog(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)
                     throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Creates and returns a new 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.

Parameters:
parentComponent - determines the frame in which the dialog is displayed; if the parentComponent has no Frame, a default Frame is used
title - the title string for the dialog
Returns:
a new JDialog containing this instance
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

showInternalMessageDialog sample code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object)

public static void showInternalMessageDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                             Object sample code for java.lang.Object definition code for java.lang.Object  message)
Brings up an internal confirmation dialog panel. The dialog is a 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 sample code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

public static void showInternalMessageDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                             Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                             String sample code for java.lang.String definition code for java.lang.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 sample code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showInternalMessageDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon)

public static void showInternalMessageDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                             Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                             String sample code for java.lang.String definition code for java.lang.String  title,
                                             int messageType,
                                             Icon sample code for javax.swing.Icon definition code for javax.swing.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 sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object)

public static int showInternalConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                            Object sample code for java.lang.Object definition code for java.lang.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 integer indicating the option selected by the user

showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

public static int showInternalConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                            Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                            String sample code for java.lang.String definition code for java.lang.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 integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
Returns:
an integer indicating the option selected by the user

showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int)

public static int showInternalConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                            Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                            String sample code for java.lang.String definition code for java.lang.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 integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_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
Returns:
an integer indicating the option selected by the user

showInternalConfirmDialog sample code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon) definition code for javax.swing.JOptionPane.showInternalConfirmDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon)

public static int showInternalConfirmDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                            Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                            String sample code for java.lang.String definition code for java.lang.String  title,
                                            int optionType,
                                            int messageType,
                                            Icon sample code for javax.swing.Icon definition code for javax.swing.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 integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_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 dialog
Returns:
an integer indicating the option selected by the user

showInternalOptionDialog sample code for javax.swing.JOptionPane.showInternalOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showInternalOptionDialog(java.awt.Component, java.lang.Object, java.lang.String, int, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)

public static int showInternalOptionDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                           Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                           String sample code for java.lang.String definition code for java.lang.String  title,
                                           int optionType,
                                           int messageType,
                                           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)
Brings up an internal dialog panel 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.

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 integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_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 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; only meaningful if options is used; can be null
Returns:
an integer indicating the option chosen by the user, or CLOSED_OPTION if the user closed the Dialog

showInternalInputDialog sample code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object) definition code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object)

public static String sample code for java.lang.String definition code for java.lang.String  showInternalInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                             Object sample code for java.lang.Object definition code for java.lang.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 sample code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int) definition code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int)

public static String sample code for java.lang.String definition code for java.lang.String  showInternalInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                             Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                             String sample code for java.lang.String definition code for java.lang.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 sample code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object) definition code for javax.swing.JOptionPane.showInternalInputDialog(java.awt.Component, java.lang.Object, java.lang.String, int, javax.swing.Icon, java.lang.Object[], java.lang.Object)

public static Object sample code for java.lang.Object definition code for java.lang.Object  showInternalInputDialog(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent,
                                             Object sample code for java.lang.Object definition code for java.lang.Object  message,
                                             String sample code for java.lang.String definition code for java.lang.String  title,
                                             int messageType,
                                             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 [] selectionValues,
                                             Object sample code for java.lang.Object definition code for java.lang.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:
user's input, or null meaning the user canceled the input

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)

public JInternalFrame sample code for javax.swing.JInternalFrame definition code for javax.swing.JInternalFrame  createInternalFrame(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. The internal frame is created with the specified title, and wrapping the JOptionPane. The returned JInternalFrame is added to the JDesktopPane ancestor of parentComponent, or components parent if one its ancestors isn't a JDesktopPane, or if parentComponent doesn't have a parent then a RuntimeException is thrown.

Parameters:
parentComponent - the parent Component for the internal frame
title - the String to display in the frame's title bar
Returns:
a JInternalFrame containing a JOptionPane
Throws:
RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException - if parentComponent does not have a valid parent

getFrameForComponent sample code for javax.swing.JOptionPane.getFrameForComponent(java.awt.Component) definition code for javax.swing.JOptionPane.getFrameForComponent(java.awt.Component)

public static Frame sample code for java.awt.Frame definition code for java.awt.Frame  getFrameForComponent(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent)
                                  throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Returns the specified component's Frame.

Parameters:
parentComponent - the Component to check for a Frame
Returns:
the Frame that contains the component, or the default frame if the component is null, or does not have a valid Frame parent
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

getDesktopPaneForComponent sample code for javax.swing.JOptionPane.getDesktopPaneForComponent(java.awt.Component) definition code for javax.swing.JOptionPane.getDesktopPaneForComponent(java.awt.Component)

public static JDesktopPane sample code for javax.swing.JDesktopPane definition code for javax.swing.JDesktopPane  getDesktopPaneForComponent(Component sample code for java.awt.Component definition code for java.awt.Component  parentComponent)
Returns the specified component's desktop pane.

Parameters:
parentComponent - the Component to check for a desktop
Returns:
the JDesktopPane that contains the component, or null if the component is null or does not have an ancestor that is a JInternalFrame

setRootFrame sample code for javax.swing.JOptionPane.setRootFrame(java.awt.Frame) definition code for javax.swing.JOptionPane.setRootFrame(java.awt.Frame)

public static void setRootFrame(Frame sample code for java.awt.Frame definition code for java.awt.Frame  newRootFrame)
Sets the frame to use for class methods in which a frame is not provided.

Parameters:
newRootFrame - the default Frame to use

getRootFrame sample code for javax.swing.JOptionPane.getRootFrame() definition code for javax.swing.JOptionPane.getRootFrame()

public static Frame sample code for java.awt.Frame definition code for java.awt.Frame  getRootFrame()
                          throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Returns the Frame to use for the class methods in which a frame is not provided.

Returns:
the default Frame to use
Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless returns true
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

setUI sample code for javax.swing.JOptionPane.setUI(javax.swing.plaf.OptionPaneUI) definition code for javax.swing.JOptionPane.setUI(javax.swing.plaf.OptionPaneUI)

public void setUI(OptionPaneUI sample code for javax.swing.plaf.OptionPaneUI definition code for javax.swing.plaf.OptionPaneUI  ui)
Sets the UI object which implements the L&F for this component.

Parameters:
ui - the OptionPaneUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

getUI sample code for javax.swing.JOptionPane.getUI() definition code for javax.swing.JOptionPane.getUI()

public OptionPaneUI sample code for javax.swing.plaf.OptionPaneUI definition code for javax.swing.plaf.OptionPaneUI  getUI()
Returns the UI object which implements the L&F for this component.

Returns:
the OptionPaneUI object

updateUI sample code for javax.swing.JOptionPane.updateUI() definition code for javax.swing.JOptionPane.updateUI()

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.

Overrides:
updateUI sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
See Also:
JComponent.updateUI() sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI()

getUIClassID sample code for javax.swing.JOptionPane.getUIClassID() definition code for javax.swing.JOptionPane.getUIClassID()

public String sample code for java.lang.String definition code for java.lang.String  getUIClassID()
Returns the name of the UI class that implements the L&F for this component.

Overrides:
getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
the string "OptionPaneUI"
See Also:
JComponent.getUIClassID() sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() , UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

setMessage sample code for javax.swing.JOptionPane.setMessage(java.lang.Object) definition code for javax.swing.JOptionPane.setMessage(java.lang.Object)

public void setMessage(Object sample code for java.lang.Object definition code for java.lang.Object  newMessage)
Sets the option pane's message-object.

Parameters:
newMessage - the Object to display
See Also:
getMessage() sample code for javax.swing.JOptionPane.getMessage() definition code for javax.swing.JOptionPane.getMessage()

getMessage sample code for javax.swing.JOptionPane.getMessage() definition code for javax.swing.JOptionPane.getMessage()

public Object sample code for java.lang.Object definition code for java.lang.Object  getMessage()
Returns the message-object this pane displays.

Returns:
the Object that is displayed
See Also:
setMessage(java.lang.Object) sample code for javax.swing.JOptionPane.setMessage(java.lang.Object) definition code for javax.swing.JOptionPane.setMessage(java.lang.Object)

setIcon sample code for javax.swing.JOptionPane.setIcon(javax.swing.Icon) definition code for javax.swing.JOptionPane.setIcon(javax.swing.Icon)

public void setIcon(Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  newIcon)
Sets the icon to display. If non-null, the look and feel does not provide an icon.

Parameters:
newIcon - the Icon to display
See Also:
getIcon() sample code for javax.swing.JOptionPane.getIcon() definition code for javax.swing.JOptionPane.getIcon()

getIcon sample code for javax.swing.JOptionPane.getIcon() definition code for javax.swing.JOptionPane.getIcon()

public Icon sample code for javax.swing.Icon definition code for javax.swing.Icon  getIcon()
Returns the icon this pane displays.

Returns:
the Icon that is displayed
See Also:
setIcon(javax.swing.Icon) sample code for javax.swing.JOptionPane.setIcon(javax.swing.Icon) definition code for javax.swing.JOptionPane.setIcon(javax.swing.Icon)

setValue sample code for javax.swing.JOptionPane.setValue(java.lang.Object) definition code for javax.swing.JOptionPane.setValue(java.lang.Object)

public void setValue(Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
Sets the value the user has chosen.

Parameters:
newValue - the chosen value
See Also:
getValue() sample code for javax.swing.JOptionPane.getValue() definition code for javax.swing.JOptionPane.getValue()

getValue sample code for javax.swing.JOptionPane.getValue() definition code for javax.swing.JOptionPane.getValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getValue()
Returns the value the user has selected. UNINITIALIZED_VALUE implies the user has not yet made a choice, null means the user closed the window with out choosing anything. Otherwise the returned value will be one of the options defined in this object.

Returns:
the Object chosen by the user, UNINITIALIZED_VALUE if the user has not yet made a choice, or null if the user closed the window without making a choice
See Also:
setValue(java.lang.Object) sample code for javax.swing.JOptionPane.setValue(java.lang.Object) definition code for javax.swing.JOptionPane.setValue(java.lang.Object)

setOptions sample code for javax.swing.JOptionPane.setOptions(java.lang.Object[]) definition code for javax.swing.JOptionPane.setOptions(java.lang.Object[])

public void setOptions(Object sample code for java.lang.Object definition code for java.lang.Object [] newOptions)
Sets the options this pane displays. If an element in newOptions is a Component it is added directly to the pane, otherwise a button is created for the element.

Parameters:
newOptions - an array of Objects that create the buttons the user can click on, or arbitrary Components to add to the pane
See Also:
getOptions() sample code for javax.swing.JOptionPane.getOptions() definition code for javax.swing.JOptionPane.getOptions()

getOptions sample code for javax.swing.JOptionPane.getOptions() definition code for javax.swing.JOptionPane.getOptions()

public Object sample code for java.lang.Object definition code for java.lang.Object [] getOptions()
Returns the choices the user can make.

Returns:
the array of Objects that give the user's choices
See Also:
setOptions(java.lang.Object[]) sample code for javax.swing.JOptionPane.setOptions(java.lang.Object[]) definition code for javax.swing.JOptionPane.setOptions(java.lang.Object[])

setInitialValue sample code for javax.swing.JOptionPane.setInitialValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialValue(java.lang.Object)

public void setInitialValue(Object sample code for java.lang.Object definition code for java.lang.Object  newInitialValue)
Sets the initial value that is to be enabled -- the Component that has the focus when the pane is initially displayed.

Parameters:
newInitialValue - the Object that gets the initial keyboard focus
See Also:
getInitialValue() sample code for javax.swing.JOptionPane.getInitialValue() definition code for javax.swing.JOptionPane.getInitialValue()

getInitialValue sample code for javax.swing.JOptionPane.getInitialValue() definition code for javax.swing.JOptionPane.getInitialValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getInitialValue()
Returns the initial value.

Returns:
the Object that gets the initial keyboard focus
See Also:
setInitialValue(java.lang.Object) sample code for javax.swing.JOptionPane.setInitialValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialValue(java.lang.Object)

setMessageType sample code for javax.swing.JOptionPane.setMessageType(int) definition code for javax.swing.JOptionPane.setMessageType(int)

public void setMessageType(int newType)
Sets the option pane's message type. The message type is used by the Look and Feel to determine the icon to display (if not supplied) as well as potentially how to lay out the parentComponent.

Parameters:
newType - an integer specifying the kind of message to display: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
Throws:
RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException - if newType is not one of the legal values listed above
See Also:
getMessageType() sample code for javax.swing.JOptionPane.getMessageType() definition code for javax.swing.JOptionPane.getMessageType()

getMessageType sample code for javax.swing.JOptionPane.getMessageType() definition code for javax.swing.JOptionPane.getMessageType()

public int getMessageType()
Returns the message type.

Returns:
an integer specifying the message type
See Also:
setMessageType(int) sample code for javax.swing.JOptionPane.setMessageType(int) definition code for javax.swing.JOptionPane.setMessageType(int)

setOptionType sample code for javax.swing.JOptionPane.setOptionType(int) definition code for javax.swing.JOptionPane.setOptionType(int)

public void setOptionType(int newType)
Sets the options to display. The option type is used by the Look and Feel to determine what buttons to show (unless options are supplied).

Parameters:
newType - an integer specifying the options the L&F is to display: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION
Throws:
RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException - if newType is not one of the legal values listed above
See Also:
getOptionType() sample code for javax.swing.JOptionPane.getOptionType() definition code for javax.swing.JOptionPane.getOptionType() , setOptions(java.lang.Object[]) sample code for javax.swing.JOptionPane.setOptions(java.lang.Object[]) definition code for javax.swing.JOptionPane.setOptions(java.lang.Object[])

getOptionType sample code for javax.swing.JOptionPane.getOptionType() definition code for javax.swing.JOptionPane.getOptionType()

public int getOptionType()
Returns the type of options that are displayed.

Returns:
an integer specifying the user-selectable options
See Also:
setOptionType(int) sample code for javax.swing.JOptionPane.setOptionType(int) definition code for javax.swing.JOptionPane.setOptionType(int)

setSelectionValues sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[])

public void setSelectionValues(Object sample code for java.lang.Object definition code for java.lang.Object [] newValues)
Sets the input selection values for a pane that provides the user with a list of items to choose from. (The UI provides a widget for choosing one of the values.) A null value implies the user can input whatever they wish, usually by means of a JTextField.

Sets wantsInput to true. Use setInitialSelectionValue to specify the initially-chosen value. After the pane as been enabled, inputValue is set to the value the user has selected.

Parameters:
newValues - an array of Objects the user to be displayed (usually in a list or combo-box) from which the user can make a selection
See Also:
setWantsInput(boolean) sample code for javax.swing.JOptionPane.setWantsInput(boolean) definition code for javax.swing.JOptionPane.setWantsInput(boolean) , setInitialSelectionValue(java.lang.Object) sample code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) , getSelectionValues() sample code for javax.swing.JOptionPane.getSelectionValues() definition code for javax.swing.JOptionPane.getSelectionValues()

getSelectionValues sample code for javax.swing.JOptionPane.getSelectionValues() definition code for javax.swing.JOptionPane.getSelectionValues()

public Object sample code for java.lang.Object definition code for java.lang.Object [] getSelectionValues()
Returns the input selection values.

Returns:
the array of Objects the user can select
See Also:
setSelectionValues(java.lang.Object[]) sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[])

setInitialSelectionValue sample code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object)

public void setInitialSelectionValue(Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
Sets the input value that is initially displayed as selected to the user. Only used if wantsInput is true.

Parameters:
newValue - the initially selected value
See Also:
setSelectionValues(java.lang.Object[]) sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) , getInitialSelectionValue() sample code for javax.swing.JOptionPane.getInitialSelectionValue() definition code for javax.swing.JOptionPane.getInitialSelectionValue()

getInitialSelectionValue sample code for javax.swing.JOptionPane.getInitialSelectionValue() definition code for javax.swing.JOptionPane.getInitialSelectionValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getInitialSelectionValue()
Returns the input value that is displayed as initially selected to the user.

Returns:
the initially selected value
See Also:
setInitialSelectionValue(java.lang.Object) sample code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) , setSelectionValues(java.lang.Object[]) sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[])

setInputValue sample code for javax.swing.JOptionPane.setInputValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInputValue(java.lang.Object)

public void setInputValue(Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
Sets the input value that was selected or input by the user. Only used if wantsInput is true. Note that this method is invoked internally by the option pane (in response to user action) and should generally not be called by client programs. To set the input value initially displayed as selected to the user, use setInitialSelectionValue.

Parameters:
newValue - the Object used to set the value that the user specified (usually in a text field)
See Also:
setSelectionValues(java.lang.Object[]) sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) , setInitialSelectionValue(java.lang.Object) sample code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInitialSelectionValue(java.lang.Object) , setWantsInput(boolean) sample code for javax.swing.JOptionPane.setWantsInput(boolean) definition code for javax.swing.JOptionPane.setWantsInput(boolean) , getInputValue() sample code for javax.swing.JOptionPane.getInputValue() definition code for javax.swing.JOptionPane.getInputValue()

getInputValue sample code for javax.swing.JOptionPane.getInputValue() definition code for javax.swing.JOptionPane.getInputValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getInputValue()
Returns the value the user has input, if wantsInput is true.

Returns:
the Object the user specified, if it was one of the objects, or a String if it was a value typed into a field
See Also:
setSelectionValues(java.lang.Object[]) sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) , setWantsInput(boolean) sample code for javax.swing.JOptionPane.setWantsInput(boolean) definition code for javax.swing.JOptionPane.setWantsInput(boolean) , setInputValue(java.lang.Object) sample code for javax.swing.JOptionPane.setInputValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInputValue(java.lang.Object)

getMaxCharactersPerLineCount sample code for javax.swing.JOptionPane.getMaxCharactersPerLineCount() definition code for javax.swing.JOptionPane.getMaxCharactersPerLineCount()

public int getMaxCharactersPerLineCount()
Returns the maximum number of characters to place on a line in a message. Default is to return Integer.MAX_VALUE. The value can be changed by overriding this method in a subclass.

Returns:
an integer giving the maximum number of characters on a line

setWantsInput sample code for javax.swing.JOptionPane.setWantsInput(boolean) definition code for javax.swing.JOptionPane.setWantsInput(boolean)

public void setWantsInput(boolean newValue)
Sets the wantsInput property. If newValue is true, an input component (such as a text field or combo box) whose parent is parentComponent is provided to allow the user to input a value. If getSelectionValues returns a non-null array, the input value is one of the objects in that array. Otherwise the input value is whatever the user inputs.

This is a bound property.

See Also:
setSelectionValues(java.lang.Object[]) sample code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) definition code for javax.swing.JOptionPane.setSelectionValues(java.lang.Object[]) , setInputValue(java.lang.Object) sample code for javax.swing.JOptionPane.setInputValue(java.lang.Object) definition code for javax.swing.JOptionPane.setInputValue(java.lang.Object)

getWantsInput sample code for javax.swing.JOptionPane.getWantsInput() definition code for javax.swing.JOptionPane.getWantsInput()

public boolean getWantsInput()
Returns the value of the wantsInput property.

Returns:
true if an input component will be provided
See Also:
setWantsInput(boolean) sample code for javax.swing.JOptionPane.setWantsInput(boolean) definition code for javax.swing.JOptionPane.setWantsInput(boolean)

selectInitialValue sample code for javax.swing.JOptionPane.selectInitialValue() definition code for javax.swing.JOptionPane.selectInitialValue()

public void selectInitialValue()
Requests that the initial value be selected, which will set focus to the initial value. This method should be invoked after the window containing the option pane is made visible.


paramString sample code for javax.swing.JOptionPane.paramString() definition code for javax.swing.JOptionPane.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representation of this JOptionPane. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString sample code for javax.swing.JComponent.paramString() definition code for javax.swing.JComponent.paramString() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
a string representation of this JOptionPane

getAccessibleContext sample code for javax.swing.JOptionPane.getAccessibleContext() definition code for javax.swing.JOptionPane.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Returns the AccessibleContext associated with this JOptionPane. For option panes, the AccessibleContext takes the form of an AccessibleJOptionPane. A new AccessibleJOptionPane instance is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for javax.swing.JComponent.getAccessibleContext() definition code for javax.swing.JComponent.getAccessibleContext() in class JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent
Returns:
an AccessibleJOptionPane that serves as the AccessibleContext of this AccessibleJOptionPane