3909N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * <code>JOptionPane</code> makes it easy to pop up a standard dialog box that 0N/A * prompts users for a value or informs them of something. 0N/A * For information about using <code>JOptionPane</code>, see 0N/A * a section in <em>The Java Tutorial</em>. 0N/A * While the <code>JOptionPane</code> 0N/A * class may appear complex because of the large number of methods, almost 0N/A * all uses of this class are one-line calls to one of the static 0N/A * <code>showXxxDialog</code> methods shown below: 0N/A * <table border=1 summary="Common JOptionPane method names and their descriptions"> 0N/A * <th>Method Name</th> 0N/A * <th>Description</th> 0N/A * <td>showConfirmDialog</td> 0N/A * <td>showInputDialog</td> 0N/A * <td>Prompt for some input.</td> 0N/A * <td>showMessageDialog</td> 0N/A * <td>Tell the user about something that has happened.</td> 0N/A * <td>showOptionDialog</td> 0N/A * <td>The Grand Unification of the above three.</td> 0N/A * Each of these methods also comes in a <code>showInternalXXX</code> 0N/A * flavor, which uses an internal frame to hold the dialog box (see 0N/A * {@link JInternalFrame}). 0N/A * Multiple convenience methods have also been defined -- overloaded 0N/A * versions of the basic methods that use different parameter lists. 0N/A * All dialogs are modal. Each <code>showXxxDialog</code> method blocks 0N/A * the caller until the user's interaction is complete. 0N/A * <table cellspacing=6 cellpadding=4 border=0 align=right summary="layout"> 0N/A * <td bgcolor=#FFe0d0 rowspan=2>icon</td> 0N/A * <td bgcolor=#FFe0d0>message</td> 0N/A * <td bgcolor=#FFe0d0>input value</td> 0N/A * <td bgcolor=#FFe0d0 colspan=2>option buttons</td> 0N/A * The basic appearance of one of these dialog boxes is generally 0N/A * similar to the picture at the right, although the various 0N/A * look-and-feels are 0N/A * ultimately responsible for the final result. In particular, the 0N/A * look-and-feels will adjust the layout to accommodate the option pane's 0N/A * <code>ComponentOrientation</code> property. 0N/A * <b>Parameters:</b><br> 0N/A * The parameters to these methods follow consistent patterns: 0N/A * <dt>parentComponent<dd> 0N/A * Defines the <code>Component</code> that is to be the parent of this 0N/A * It is used in two ways: the <code>Frame</code> that contains 0N/A * it is used as the <code>Frame</code> 0N/A * parent for the dialog box, and its screen coordinates are used in 0N/A * the placement of the dialog box. In general, the dialog box is placed 0N/A * just below the component. This parameter may be <code>null</code>, 0N/A * in which case a default <code>Frame</code> is used as the parent, 0N/A * and the dialog will be 0N/A * centered on the screen (depending on the L&F). 0N/A * <dt><a name=message>message</a><dd> 0N/A * A descriptive message to be placed in the dialog box. 0N/A * In the most common usage, message is just a <code>String</code> or 0N/A * <code>String</code> constant. 0N/A * However, the type of this parameter is actually <code>Object</code>. Its 0N/A * interpretation depends on its type: 0N/A * <dt>Object[]<dd>An array of objects is interpreted as a series of 0N/A * messages (one per object) arranged in a vertical stack. 0N/A * The interpretation is recursive -- each object in the 0N/A * array is interpreted according to its type. 0N/A * <dt>Component<dd>The <code>Component</code> is displayed in the dialog. 0N/A * <dt>Icon<dd>The <code>Icon</code> is wrapped in a <code>JLabel</code> 0N/A * and displayed in the dialog. 0N/A * <dt>others<dd>The object is converted to a <code>String</code> by calling 0N/A * its <code>toString</code> method. The result is wrapped in a 0N/A * <code>JLabel</code> and displayed. 0N/A * <dt>messageType<dd>Defines the style of the message. The Look and Feel 0N/A * manager may lay out the dialog differently depending on this value, and 0N/A * will often provide a default icon. The possible values are: 0N/A * <li><code>ERROR_MESSAGE</code> 0N/A * <li><code>INFORMATION_MESSAGE</code> 0N/A * <li><code>WARNING_MESSAGE</code> 0N/A * <li><code>QUESTION_MESSAGE</code> 0N/A * <li><code>PLAIN_MESSAGE</code> 0N/A * <dt>optionType<dd>Defines the set of option buttons that appear at 0N/A * the bottom of the dialog box: 0N/A * <li><code>DEFAULT_OPTION</code> 0N/A * <li><code>YES_NO_OPTION</code> 0N/A * <li><code>YES_NO_CANCEL_OPTION</code> 0N/A * <li><code>OK_CANCEL_OPTION</code> 0N/A * You aren't limited to this set of option buttons. You can provide any 0N/A * buttons you want using the options parameter. 0N/A * <dt>options<dd>A more detailed description of the set of option buttons 0N/A * that will appear at the bottom of the dialog box. 0N/A * The usual value for the options parameter is an array of 0N/A * <code>String</code>s. But 0N/A * the parameter type is an array of <code>Objects</code>. 0N/A * A button is created for each object depending on its type: 0N/A * <dt>Component<dd>The component is added to the button row directly. 0N/A * <dt>Icon<dd>A <code>JButton</code> is created with this as its label. 0N/A * <dt>other<dd>The <code>Object</code> is converted to a string using its 0N/A * <code>toString</code> method and the result is used to 0N/A * label a <code>JButton</code>. 0N/A * <dt>icon<dd>A decorative icon to be placed in the dialog box. A default 0N/A * value for this is determined by the <code>messageType</code> parameter. 0N/A * <dt>title<dd>The title for the dialog box. 0N/A * <dt>initialValue<dd>The default selection (input value). 0N/A * When the selection is changed, <code>setValue</code> is invoked, 0N/A * which generates a <code>PropertyChangeEvent</code>. 0N/A * If a <code>JOptionPane</code> has configured to all input 0N/A * <code>setWantsInput</code> 0N/A * the bound property <code>JOptionPane.INPUT_VALUE_PROPERTY</code> 0N/A * can also be listened 0N/A * to, to determine when the user has input or selected a value. 0N/A * When one of the <code>showXxxDialog</code> methods returns an integer, 0N/A * the possible values are: 0N/A * <li><code>YES_OPTION</code> 0N/A * <li><code>NO_OPTION</code> 0N/A * <li><code>CANCEL_OPTION</code> 0N/A * <li><code>OK_OPTION</code> 0N/A * <li><code>CLOSED_OPTION</code> 0N/A * <dt>Show an error dialog that displays the message, 'alert': 0N/A * JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE); 0N/A * <dt>Show an internal information dialog with the message, 'information': 0N/A * JOptionPane.showInternalMessageDialog(frame, "information",<br> 0N/A * <ul><ul>"information", JOptionPane.INFORMATION_MESSAGE);</ul></ul> 0N/A * <dt>Show an information panel with the options yes/no and message 'choose one': 0N/A * <dd><code>JOptionPane.showConfirmDialog(null, 0N/A * <ul><ul>"choose one", "choose one", JOptionPane.YES_NO_OPTION);</ul></ul> 0N/A * <dt>Show an internal information dialog with the options yes/no/cancel and 0N/A * message 'please choose one' and title information: 0N/A * <dd><code>JOptionPane.showInternalConfirmDialog(frame, 0N/A * <ul><ul>"please choose one", "information",</ul></ul> 0N/A * <ul><ul>JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);</ul></ul> 0N/A * <dt>Show a warning dialog with the options OK, CANCEL, title 'Warning', and 0N/A * message 'Click OK to continue': 0N/A * Object[] options = { "OK", "CANCEL" };<br> 0N/A * JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning", 0N/A * <ul><ul>JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,</ul></ul> 0N/A * <ul><ul>null, options, options[0]);</ul></ul> 0N/A * <dt>Show a dialog asking the user to type in a String: 0N/A * String inputValue = JOptionPane.showInputDialog("Please input a value"); 0N/A * <dt>Show a dialog asking the user to select a String: 0N/A * Object[] possibleValues = { "First", "Second", "Third" };<br> 0N/A * Object selectedValue = JOptionPane.showInputDialog(null, 0N/A * <ul><ul>"Choose one", "Input",</ul></ul> 0N/A * <ul><ul>JOptionPane.INFORMATION_MESSAGE, null,</ul></ul> 0N/A * <ul><ul>possibleValues, possibleValues[0]);</ul></ul> 0N/A * <b>Direct Use:</b><br> 0N/A * To create and use an <code>JOptionPane</code> directly, the 0N/A * standard pattern is roughly as follows: 0N/A * JOptionPane pane = new JOptionPane(<i>arguments</i>); 0N/A * pane.set<i>.Xxxx(...); // Configure</i> 0N/A * JDialog dialog = pane.createDialog(<i>parentComponent, title</i>); 0N/A * Object selectedValue = pane.getValue(); 0N/A * if(selectedValue == null) 0N/A * return CLOSED_OPTION; 0N/A * <i>//If there is <b>not</b> an array of option buttons:</i> 0N/A * if(options == null) { 0N/A * if(selectedValue instanceof Integer) 0N/A * return ((Integer)selectedValue).intValue(); 0N/A * return CLOSED_OPTION; 0N/A * <i>//If there is an array of option buttons:</i> 0N/A * for(int counter = 0, maxCounter = options.length; 0N/A * counter < maxCounter; counter++) { 0N/A * if(options[counter].equals(selectedValue)) 0N/A * return CLOSED_OPTION; 0N/A * <strong>Warning:</strong> Swing is not thread safe. For more 0N/A * information see <a 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * @see JInternalFrame 0N/A * attribute: isContainer true 0N/A * description: A component which implements standard dialog box controls. 0N/A * @author James Gosling 0N/A * @author Scott Violet 0N/A * @see #getUIClassID 0N/A * Indicates that the user has not yet selected a value. 0N/A * Type meaning Look and Feel should not supply any options -- only 0N/A * use the options from the <code>JOptionPane</code>. 0N/A /** Type used for <code>showConfirmDialog</code>. */ 0N/A /** Type used for <code>showConfirmDialog</code>. */ 0N/A /** Type used for <code>showConfirmDialog</code>. */ 0N/A /** Return value from class method if YES is chosen. */ 0N/A /** Return value from class method if NO is chosen. */ 0N/A /** Return value from class method if CANCEL is chosen. */ 0N/A /** Return value form class method if OK is chosen. */ 0N/A /** Return value from class method if user closes window without selecting 0N/A * anything, more than likely this should be treated as either a 0N/A * <code>CANCEL_OPTION</code> or <code>NO_OPTION</code>. */ 0N/A // Message types. Used by the UI to determine what icon to display, 0N/A // and possibly what behavior to give based on the type. 0N/A /** Used for error messages. */ 0N/A /** Used for information messages. */ 0N/A /** Used for warning messages. */ 0N/A /** Used for questions. */ 0N/A /** No icon is used. */ 0N/A /** Bound property name for <code>icon</code>. */ 0N/A /** Bound property name for <code>message</code>. */ 0N/A /** Bound property name for <code>value</code>. */ 0N/A /** Bound property name for <code>option</code>. */ 0N/A /** Bound property name for <code>initialValue</code>. */ 0N/A /** Bound property name for <code>type</code>. */ 0N/A /** Bound property name for <code>optionType</code>. */ 0N/A /** Bound property name for <code>selectionValues</code>. */ 0N/A /** Bound property name for <code>initialSelectionValue</code>. */ 0N/A /** Bound property name for <code>inputValue</code>. */ 0N/A /** Bound property name for <code>wantsInput</code>. */ 0N/A /** Icon used in pane. */ 0N/A /** Message to display. */ 0N/A /** Options to display to the user. */ 0N/A /** Value that should be initially selected in <code>options</code>. */ 0N/A /** Message type. */ 0N/A * Option type, one of <code>DEFAULT_OPTION</code>, 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code> or 0N/A * <code>OK_CANCEL_OPTION</code>. 0N/A /** Currently selected value, will be a valid option, or 0N/A * <code>UNINITIALIZED_VALUE</code> or <code>null</code>. */ 0N/A /** Array of values the user can choose from. Look and feel will 0N/A * provide the UI component to choose this from. */ 0N/A /** Value the user has input. */ 0N/A /** Initial value to select in <code>selectionValues</code>. */ 0N/A /** If true, a UI widget will be provided to the user to get input. */ 0N/A * Shows a question-message dialog requesting input from the user. The 0N/A * dialog uses the default frame, which usually means it is centered on 0N/A * @param message the <code>Object</code> to display 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Shows a question-message dialog requesting input from the user, with 0N/A * the input value initialized to <code>initialSelectionValue</code>. The 0N/A * dialog uses the default frame, which usually means it is centered on 0N/A * @param message the <code>Object</code> to display 0N/A * @param initialSelectionValue the value used to initialize the input 0N/A * Shows a question-message dialog requesting input from the user 0N/A * parented to <code>parentComponent</code>. 0N/A * The dialog is displayed on top of the <code>Component</code>'s 0N/A * frame, and is usually positioned below the <code>Component</code>. 0N/A * @param parentComponent the parent <code>Component</code> for the 0N/A * @param message the <code>Object</code> to display 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Shows a question-message dialog requesting input from the user and 0N/A * parented to <code>parentComponent</code>. The input value will be 0N/A * initialized to <code>initialSelectionValue</code>. 0N/A * The dialog is displayed on top of the <code>Component</code>'s 0N/A * frame, and is usually positioned below the <code>Component</code>. 0N/A * @param parentComponent the parent <code>Component</code> for the 0N/A * @param message the <code>Object</code> to display 0N/A * @param initialSelectionValue the value used to initialize the input 0N/A * Shows a dialog requesting input from the user parented to 0N/A * <code>parentComponent</code> with the dialog having the title 0N/A * <code>title</code> and message type <code>messageType</code>. 0N/A * @param parentComponent the parent <code>Component</code> for the 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the <code>String</code> to display in the dialog 0N/A * @param messageType the type of message that is to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Prompts the user for input in a blocking dialog where the 0N/A * initial selection, possible selections, and all other options can 0N/A * be specified. The user will able to choose from 0N/A * <code>selectionValues</code>, where <code>null</code> implies the 0N/A * whatever they wish, usually by means of a <code>JTextField</code>. 0N/A * <code>initialSelectionValue</code> is the initial value to prompt 0N/A * the user with. It is up to the UI to decide how best to represent 0N/A * the <code>selectionValues</code>, but usually a 0N/A * <code>JComboBox</code>, <code>JList</code>, or 0N/A * <code>JTextField</code> will be used. 0N/A * @param parentComponent the parent <code>Component</code> for the 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the <code>String</code> to display in the 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon the <code>Icon</code> image to display 0N/A * @param selectionValues an array of <code>Object</code>s that 0N/A * gives the possible selections 0N/A * @param initialSelectionValue the value used to initialize the input 0N/A * @return user's input, or <code>null</code> meaning the user 0N/A * canceled the input 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up an information-message dialog titled "Message". 0N/A * @param parentComponent determines the <code>Frame</code> in 0N/A * which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog that displays a message using a default 0N/A * icon determined by the <code>messageType</code> parameter. 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog displaying a message, specifying all parameters. 0N/A * @param parentComponent determines the <code>Frame</code> in which the 0N/A * dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a 0N/A * default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon an icon to display in the dialog that helps the user 0N/A * identify the kind of message that is being displayed 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog with the options <i>Yes</i>, 0N/A * <i>No</i> and <i>Cancel</i>; with the 0N/A * title, <b>Select an Option</b>. 0N/A * @param parentComponent determines the <code>Frame</code> in which the 0N/A * dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a 0N/A * default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @return an integer indicating the option selected by the user 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog where the number of choices is determined 0N/A * by the <code>optionType</code> parameter. 0N/A * @param parentComponent determines the <code>Frame</code> in which the 0N/A * dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a 0N/A * default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param optionType an int designating the options available on the dialog: 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * or <code>OK_CANCEL_OPTION</code> 0N/A * @return an int indicating the option selected by the user 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog where the number of choices is determined 0N/A * by the <code>optionType</code> parameter, where the 0N/A * <code>messageType</code> 0N/A * parameter determines the icon to display. 0N/A * The <code>messageType</code> parameter is primarily used to supply 0N/A * a default icon from the Look and Feel. 0N/A * @param parentComponent determines the <code>Frame</code> in 0N/A * which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a 0N/A * default <code>Frame</code> is used. 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param optionType an integer designating the options available 0N/A * on the dialog: <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * or <code>OK_CANCEL_OPTION</code> 0N/A * @param messageType an integer designating the kind of message this is; 0N/A * primarily used to determine the icon from the pluggable 0N/A * Look and Feel: <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @return an integer indicating the option selected by the user 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog with a specified icon, where the number of 0N/A * choices is determined by the <code>optionType</code> parameter. 0N/A * The <code>messageType</code> parameter is primarily used to supply 0N/A * a default icon from the look and feel. 0N/A * @param parentComponent determines the <code>Frame</code> in which the 0N/A * dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a 0N/A * default <code>Frame</code> is used 0N/A * @param message the Object to display 0N/A * @param title the title string for the dialog 0N/A * @param optionType an int designating the options available on the dialog: 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * or <code>OK_CANCEL_OPTION</code> 0N/A * @param messageType an int designating the kind of message this is, 0N/A * primarily used to determine the icon from the pluggable 0N/A * Look and Feel: <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon the icon to display in the dialog 0N/A * @return an int indicating the option selected by the user 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Brings up a dialog with a specified icon, where the initial 0N/A * choice is determined by the <code>initialValue</code> parameter and 0N/A * the number of choices is determined by the <code>optionType</code> 0N/A * If <code>optionType</code> is <code>YES_NO_OPTION</code>, 0N/A * or <code>YES_NO_CANCEL_OPTION</code> 0N/A * and the <code>options</code> parameter is <code>null</code>, 0N/A * then the options are 0N/A * supplied by the look and feel. 0N/A * The <code>messageType</code> parameter is primarily used to supply 0N/A * a default icon from the look and feel. 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if 0N/A * <code>null</code>, or if the 0N/A * <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a 0N/A * default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param optionType an integer designating the options available on the 0N/A * dialog: <code>DEFAULT_OPTION</code>, 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * or <code>OK_CANCEL_OPTION</code> 0N/A * @param messageType an integer designating the kind of message this is, 0N/A * primarily used to determine the icon from the 0N/A * pluggable Look and Feel: <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon the icon to display in the dialog 0N/A * @param options an array of objects indicating the possible choices 0N/A * the user can make; if the objects are components, they 0N/A * are rendered properly; non-<code>String</code> 0N/A * rendered using their <code>toString</code> methods; 0N/A * if this parameter is <code>null</code>, 0N/A * the options are determined by the Look and Feel 0N/A * @param initialValue the object that represents the default selection 0N/A * for the dialog; only meaningful if <code>options</code> 0N/A * is used; can be <code>null</code> 0N/A * @return an integer indicating the option chosen by the user, 0N/A * or <code>CLOSED_OPTION</code> if the user closed 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates and returns a new <code>JDialog</code> wrapping 0N/A * <code>this</code> centered on the <code>parentComponent</code> 0N/A * in the <code>parentComponent</code>'s frame. 0N/A * <code>title</code> is the title of the returned dialog. 0N/A * The returned <code>JDialog</code> will not be resizable by the 0N/A * user, however programs can invoke <code>setResizable</code> on 0N/A * the <code>JDialog</code> instance to change this property. 0N/A * The returned <code>JDialog</code> will be set up such that 0N/A * once it is closed, or the user clicks on one of the buttons, 0N/A * the optionpane's value property will be set accordingly and 0N/A * the dialog will be closed. Each time the dialog is made visible, 0N/A * it will reset the option pane's value property to 0N/A * <code>JOptionPane.UNINITIALIZED_VALUE</code> to ensure the 0N/A * user's subsequent action closes the dialog properly. 0N/A * @param parentComponent determines the frame in which the dialog 0N/A * is displayed; if the <code>parentComponent</code> has 0N/A * no <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param title the title string for the dialog 0N/A * @return a new <code>JDialog</code> containing this instance 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates and returns a new parentless <code>JDialog</code> 0N/A * with the specified title. 0N/A * The returned <code>JDialog</code> will not be resizable by the 0N/A * user, however programs can invoke <code>setResizable</code> on 0N/A * the <code>JDialog</code> instance to change this property. 0N/A * The returned <code>JDialog</code> will be set up such that 0N/A * once it is closed, or the user clicks on one of the buttons, 0N/A * the optionpane's value property will be set accordingly and 0N/A * the dialog will be closed. Each time the dialog is made visible, 0N/A * it will reset the option pane's value property to 0N/A * <code>JOptionPane.UNINITIALIZED_VALUE</code> to ensure the 0N/A * user's subsequent action closes the dialog properly. 0N/A * @param title the title string for the dialog 0N/A * @return a new <code>JDialog</code> containing this instance 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 3728N/A // Let the defaultCloseOperation handle the closing 3728N/A // if the user closed the window without selecting a button 3728N/A // (newValue = null in that case). Otherwise, close the dialog. 0N/A // Once window gets focus, set initial focus 0N/A // reset value to ensure closing works properly 0N/A * Brings up an internal confirmation dialog panel. The dialog 0N/A * is a information-message dialog titled "Message". 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the object to display 0N/A * Brings up an internal dialog panel that displays a message 0N/A * using a default icon determined by the <code>messageType</code> 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * Brings up an internal dialog panel displaying a message, 0N/A * specifying all parameters. 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the title string for the dialog 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon an icon to display in the dialog that helps the user 0N/A * identify the kind of message that is being displayed 0N/A * Brings up an internal dialog panel with the options <i>Yes</i>, <i>No</i> 0N/A * and <i>Cancel</i>; with the title, <b>Select an Option</b>. 0N/A * @param parentComponent determines the <code>Frame</code> in 0N/A * which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the <code>Object</code> to display 0N/A * @return an integer indicating the option selected by the user 0N/A * Brings up a internal dialog panel where the number of choices 0N/A * is determined by the <code>optionType</code> parameter. 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the object to display in the dialog; a 0N/A * <code>Component</code> object is rendered as a 0N/A * <code>Component</code>; a <code>String</code> 0N/A * object is rendered as a string; other objects 0N/A * are converted to a <code>String</code> using the 0N/A * <code>toString</code> method 0N/A * @param title the title string for the dialog 0N/A * @param optionType an integer designating the options 0N/A * available on the dialog: <code>YES_NO_OPTION</code>, 0N/A * or <code>YES_NO_CANCEL_OPTION</code> 0N/A * @return an integer indicating the option selected by the user 0N/A * Brings up an internal dialog panel where the number of choices 0N/A * is determined by the <code>optionType</code> parameter, where 0N/A * the <code>messageType</code> parameter determines the icon to display. 0N/A * The <code>messageType</code> parameter is primarily used to supply 0N/A * a default icon from the Look and Feel. 0N/A * @param parentComponent determines the <code>Frame</code> in 0N/A * which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the object to display in the dialog; a 0N/A * <code>Component</code> object is rendered as a 0N/A * <code>Component</code>; a <code>String</code> 0N/A * object is rendered as a string; other objects are 0N/A * converted to a <code>String</code> using the 0N/A * <code>toString</code> method 0N/A * @param title the title string for the dialog 0N/A * @param optionType an integer designating the options 0N/A * available on the dialog: 0N/A * <code>YES_NO_OPTION</code>, or <code>YES_NO_CANCEL_OPTION</code> 0N/A * @param messageType an integer designating the kind of message this is, 0N/A * primarily used to determine the icon from the 0N/A * pluggable Look and Feel: <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @return an integer indicating the option selected by the user 0N/A * Brings up an internal dialog panel with a specified icon, where 0N/A * the number of choices is determined by the <code>optionType</code> 0N/A * The <code>messageType</code> parameter is primarily used to supply 0N/A * a default icon from the look and feel. 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the parentComponent has no Frame, a 0N/A * default <code>Frame</code> is used 0N/A * @param message the object to display in the dialog; a 0N/A * <code>Component</code> object is rendered as a 0N/A * <code>Component</code>; a <code>String</code> 0N/A * object is rendered as a string; other objects are 0N/A * converted to a <code>String</code> using the 0N/A * <code>toString</code> method 0N/A * @param title the title string for the dialog 0N/A * @param optionType an integer designating the options available 0N/A * <code>YES_NO_OPTION</code>, or 0N/A * <code>YES_NO_CANCEL_OPTION</code>. 0N/A * @param messageType an integer designating the kind of message this is, 0N/A * primarily used to determine the icon from the pluggable 0N/A * Look and Feel: <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon the icon to display in the dialog 0N/A * @return an integer indicating the option selected by the user 0N/A * Brings up an internal dialog panel with a specified icon, where 0N/A * the initial choice is determined by the <code>initialValue</code> 0N/A * parameter and the number of choices is determined by the 0N/A * <code>optionType</code> parameter. 0N/A * If <code>optionType</code> is <code>YES_NO_OPTION</code>, or 0N/A * <code>YES_NO_CANCEL_OPTION</code> 0N/A * and the <code>options</code> parameter is <code>null</code>, 0N/A * then the options are supplied by the Look and Feel. 0N/A * The <code>messageType</code> parameter is primarily used to supply 0N/A * a default icon from the look and feel. 0N/A * @param parentComponent determines the <code>Frame</code> 0N/A * in which the dialog is displayed; if <code>null</code>, 0N/A * or if the <code>parentComponent</code> has no 0N/A * <code>Frame</code>, a default <code>Frame</code> is used 0N/A * @param message the object to display in the dialog; a 0N/A * <code>Component</code> object is rendered as a 0N/A * <code>Component</code>; a <code>String</code> 0N/A * object is rendered as a string. Other objects are 0N/A * converted to a <code>String</code> using the 0N/A * <code>toString</code> method 0N/A * @param title the title string for the dialog 0N/A * @param optionType an integer designating the options available 0N/A * on the dialog: <code>YES_NO_OPTION</code>, 0N/A * or <code>YES_NO_CANCEL_OPTION</code> 0N/A * @param messageType an integer designating the kind of message this is; 0N/A * primarily used to determine the icon from the 0N/A * pluggable Look and Feel: <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param icon the icon to display in the dialog 0N/A * @param options an array of objects indicating the possible choices 0N/A * the user can make; if the objects are components, they 0N/A * are rendered properly; non-<code>String</code> 0N/A * objects are rendered using their <code>toString</code> 0N/A * methods; if this parameter is <code>null</code>, 0N/A * the options are determined by the Look and Feel 0N/A * @param initialValue the object that represents the default selection 0N/A * for the dialog; only meaningful if <code>options</code> 0N/A * is used; can be <code>null</code> 0N/A * @return an integer indicating the option chosen by the user, 0N/A * or <code>CLOSED_OPTION</code> if the user closed the Dialog 0N/A /* Since all input will be blocked until this dialog is dismissed, 0N/A * make sure its parent containers are visible first (this component 0N/A * is tested below). This is necessary for JApplets, because 0N/A * because an applet normally isn't made visible until after its 0N/A * start() method returns -- if this method is called from start(), 0N/A * the applet will appear to hang while an invisible modal frame 0N/A // Use reflection to get Container.startLWModal. 0N/A * Shows an internal question-message dialog requesting input from 0N/A * the user parented to <code>parentComponent</code>. The dialog 0N/A * is displayed in the <code>Component</code>'s frame, 0N/A * and is usually positioned below the <code>Component</code>. 0N/A * @param parentComponent the parent <code>Component</code> 0N/A * @param message the <code>Object</code> to display 0N/A * Shows an internal dialog requesting input from the user parented 0N/A * to <code>parentComponent</code> with the dialog having the title 0N/A * <code>title</code> and message type <code>messageType</code>. 0N/A * @param parentComponent the parent <code>Component</code> for the dialog 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the <code>String</code> to display in the 0N/A * @param messageType the type of message that is to be displayed: 0N/A * ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, 0N/A * QUESTION_MESSAGE, or PLAIN_MESSAGE 0N/A * Prompts the user for input in a blocking internal dialog where 0N/A * the initial selection, possible selections, and all other 0N/A * options can be specified. The user will able to choose from 0N/A * <code>selectionValues</code>, where <code>null</code> 0N/A * implies the user can input 0N/A * whatever they wish, usually by means of a <code>JTextField</code>. 0N/A * <code>initialSelectionValue</code> is the initial value to prompt 0N/A * the user with. It is up to the UI to decide how best to represent 0N/A * the <code>selectionValues</code>, but usually a 0N/A * <code>JComboBox</code>, <code>JList</code>, or 0N/A * <code>JTextField</code> will be used. 0N/A * @param parentComponent the parent <code>Component</code> for the dialog 0N/A * @param message the <code>Object</code> to display 0N/A * @param title the <code>String</code> to display in the dialog 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, or <code>PLAIN_MESSAGE</code> 0N/A * @param icon the <code>Icon</code> image to display 0N/A * @param selectionValues an array of <code>Objects</code> that 0N/A * gives the possible selections 0N/A * @param initialSelectionValue the value used to initialize the input 0N/A * @return user's input, or <code>null</code> meaning the user 0N/A * canceled the input 0N/A /* Since all input will be blocked until this dialog is dismissed, 0N/A * make sure its parent containers are visible first (this component 0N/A * is tested below). This is necessary for JApplets, because 0N/A * because an applet normally isn't made visible until after its 0N/A * start() method returns -- if this method is called from start(), 0N/A * the applet will appear to hang while an invisible modal frame 0N/A // Use reflection to get Container.startLWModal. 0N/A * Creates and returns an instance of <code>JInternalFrame</code>. 0N/A * The internal frame is created with the specified title, 0N/A * and wrapping the <code>JOptionPane</code>. 0N/A * The returned <code>JInternalFrame</code> is 0N/A * added to the <code>JDesktopPane</code> ancestor of 0N/A * <code>parentComponent</code>, or components 0N/A * parent if one its ancestors isn't a <code>JDesktopPane</code>, 0N/A * or if <code>parentComponent</code> 0N/A * doesn't have a parent then a <code>RuntimeException</code> is thrown. 0N/A * @param parentComponent the parent <code>Component</code> for 0N/A * the internal frame 0N/A * @param title the <code>String</code> to display in the 0N/A * @return a <code>JInternalFrame</code> containing a 0N/A * <code>JOptionPane</code> 0N/A * @exception RuntimeException if <code>parentComponent</code> does 0N/A * not have a valid parent 0N/A "not have a valid parent");
0N/A // Option dialogs should be closable only 0N/A // Let the defaultCloseOperation handle the closing 0N/A // if the user closed the iframe without selecting a button 0N/A // (newValue = null in that case). Otherwise, close the dialog. 0N/A // Use reflection to get Container.stopLWModal(). 0N/A // We want dialog centered relative to its parent component 0N/A // If possible, dialog should be fully visible 0N/A * Returns the specified component's <code>Frame</code>. 0N/A * @param parentComponent the <code>Component</code> to check for a 0N/A * <code>Frame</code> 0N/A * @return the <code>Frame</code> that contains the component, 0N/A * or <code>getRootFrame</code> 0N/A * if the component is <code>null</code>, 0N/A * or does not have a valid <code>Frame</code> parent 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see #getRootFrame 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Returns the specified component's toplevel <code>Frame</code> or 0N/A * <code>Dialog</code>. 0N/A * @param parentComponent the <code>Component</code> to check for a 0N/A * <code>Frame</code> or <code>Dialog</code> 0N/A * @return the <code>Frame</code> or <code>Dialog</code> that 0N/A * contains the component, or the default 0N/A * frame if the component is <code>null</code>, 0N/A * or does not have a valid 0N/A * <code>Frame</code> or <code>Dialog</code> parent 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Returns the specified component's desktop pane. 0N/A * @param parentComponent the <code>Component</code> to check for a 0N/A * @return the <code>JDesktopPane</code> that contains the component, 0N/A * or <code>null</code> if the component is <code>null</code> 0N/A * or does not have an ancestor that is a 0N/A * <code>JInternalFrame</code> 0N/A * Sets the frame to use for class methods in which a frame is 0N/A * <strong>Note:</strong> 0N/A * It is recommended that rather than using this method you supply a valid parent. 0N/A * @param newRootFrame the default <code>Frame</code> to use 0N/A * Returns the <code>Frame</code> to use for the class methods in 0N/A * which a frame is not provided. 0N/A * @return the default <code>Frame</code> to use 0N/A * @exception HeadlessException if 0N/A * <code>GraphicsEnvironment.isHeadless</code> returns 0N/A * @see #setRootFrame 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a <code>JOptionPane</code> with a test message. 0N/A this(
"JOptionPane message");
0N/A * Creates a instance of <code>JOptionPane</code> to display a 0N/A * plain-message message type and the default options delivered by 0N/A * @param message the <code>Object</code> to display 0N/A * Creates an instance of <code>JOptionPane</code> to display a message 0N/A * with the specified message type and the default options, 0N/A * @param message the <code>Object</code> to display 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * Creates an instance of <code>JOptionPane</code> to display a message 0N/A * with the specified message type and options. 0N/A * @param message the <code>Object</code> to display 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param optionType the options to display in the pane: 0N/A * <code>DEFAULT_OPTION</code>, <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * <code>OK_CANCEL_OPTION</code> 0N/A * Creates an instance of <code>JOptionPane</code> to display a message 0N/A * with the specified message type, options, and icon. 0N/A * @param message the <code>Object</code> to display 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param optionType the options to display in the pane: 0N/A * <code>DEFAULT_OPTION</code>, <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * <code>OK_CANCEL_OPTION</code> 0N/A * @param icon the <code>Icon</code> image to display 0N/A * Creates an instance of <code>JOptionPane</code> to display a message 0N/A * with the specified message type, icon, and options. 0N/A * None of the options is initially selected. 0N/A * The options objects should contain either instances of 0N/A * <code>Component</code>s, (which are added directly) or 0N/A * <code>Strings</code> (which are wrapped in a <code>JButton</code>). 0N/A * If you provide <code>Component</code>s, you must ensure that when the 0N/A * <code>Component</code> is clicked it messages <code>setValue</code> 0N/A * in the created <code>JOptionPane</code>. 0N/A * @param message the <code>Object</code> to display 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param optionType the options to display in the pane: 0N/A * <code>DEFAULT_OPTION</code>, 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * <code>OK_CANCEL_OPTION</code> 0N/A * @param icon the <code>Icon</code> image to display 0N/A * @param options the choices the user can select 0N/A * Creates an instance of <code>JOptionPane</code> to display a message 0N/A * with the specified message type, icon, and options, with the 0N/A * initially-selected option specified. 0N/A * @param message the <code>Object</code> to display 0N/A * @param messageType the type of message to be displayed: 0N/A * <code>ERROR_MESSAGE</code>, 0N/A * <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, 0N/A * or <code>PLAIN_MESSAGE</code> 0N/A * @param optionType the options to display in the pane: 0N/A * <code>DEFAULT_OPTION</code>, 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * <code>OK_CANCEL_OPTION</code> 0N/A * @param icon the Icon image to display 0N/A * @param options the choices the user can select 0N/A * @param initialValue the choice that is initially selected; if 0N/A * <code>null</code>, then nothing will be initially selected; 0N/A * only meaningful if <code>options</code> is used 0N/A * Sets the UI object which implements the L&F for this component. 0N/A * @param ui the <code>OptionPaneUI</code> L&F object 0N/A * @see UIDefaults#getUI 0N/A * description: The UI object that implements the optionpane's LookAndFeel 0N/A * Returns the UI object which implements the L&F for this component. 0N/A * @return the <code>OptionPaneUI</code> object 0N/A * Notification from the <code>UIManager</code> that the L&F has changed. 0N/A * Replaces the current UI object with the latest version from the 0N/A * <code>UIManager</code>. 0N/A * @see JComponent#updateUI 0N/A * Returns the name of the UI class that implements the 0N/A * L&F for this component. 0N/A * @return the string "OptionPaneUI" 0N/A * @see JComponent#getUIClassID 0N/A * @see UIDefaults#getUI 0N/A * Sets the option pane's message-object. 0N/A * @param newMessage the <code>Object</code> to display 0N/A * description: The optionpane's message object. 0N/A * Returns the message-object this pane displays. 0N/A * @return the <code>Object</code> that is displayed 0N/A * Sets the icon to display. If non-<code>null</code>, the look and feel 0N/A * does not provide an icon. 0N/A * @param newIcon the <code>Icon</code> to display 0N/A * description: The option pane's type icon. 0N/A * Returns the icon this pane displays. 0N/A * @return the <code>Icon</code> that is displayed 0N/A * Sets the value the user has chosen. 0N/A * @param newValue the chosen value 0N/A * description: The option pane's value object. 0N/A * Returns the value the user has selected. <code>UNINITIALIZED_VALUE</code> 0N/A * implies the user has not yet made a choice, <code>null</code> means the 0N/A * user closed the window with out choosing anything. Otherwise 0N/A * the returned value will be one of the options defined in this 0N/A * @return the <code>Object</code> chosen by the user, 0N/A * <code>UNINITIALIZED_VALUE</code> 0N/A * if the user has not yet made a choice, or <code>null</code> if 0N/A * the user closed the window without making a choice 0N/A * Sets the options this pane displays. If an element in 0N/A * <code>newOptions</code> is a <code>Component</code> 0N/A * it is added directly to the pane, 0N/A * otherwise a button is created for the element. 0N/A * @param newOptions an array of <code>Objects</code> that create the 0N/A * buttons the user can click on, or arbitrary 0N/A * <code>Components</code> to add to the pane 0N/A * description: The option pane's options objects. 0N/A * Returns the choices the user can make. 0N/A * @return the array of <code>Objects</code> that give the user's choices 0N/A * Sets the initial value that is to be enabled -- the 0N/A * <code>Component</code> 0N/A * that has the focus when the pane is initially displayed. 0N/A * @param newInitialValue the <code>Object</code> that gets the initial 0N/A * @see #getInitialValue 0N/A * description: The option pane's initial value object. 0N/A * Returns the initial value. 0N/A * @return the <code>Object</code> that gets the initial keyboard focus 0N/A * @see #setInitialValue 0N/A * Sets the option pane's message type. 0N/A * The message type is used by the Look and Feel to determine the 0N/A * icon to display (if not supplied) as well as potentially how to 0N/A * lay out the <code>parentComponent</code>. 0N/A * @param newType an integer specifying the kind of message to display: 0N/A * <code>ERROR_MESSAGE</code>, <code>INFORMATION_MESSAGE</code>, 0N/A * <code>WARNING_MESSAGE</code>, 0N/A * <code>QUESTION_MESSAGE</code>, or <code>PLAIN_MESSAGE</code> 0N/A * @exception RuntimeException if <code>newType</code> is not one of the 0N/A * legal values listed above 0N/A * @see #getMessageType 0N/A * description: The option pane's message type. 0N/A throw new RuntimeException(
"JOptionPane: type must be one of JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE or JOptionPane.PLAIN_MESSAGE");
0N/A * Returns the message type. 0N/A * @return an integer specifying the message type 0N/A * @see #setMessageType 0N/A * Sets the options to display. 0N/A * The option type is used by the Look and Feel to 0N/A * determine what buttons to show (unless options are supplied). 0N/A * @param newType an integer specifying the options the L&F is to display: 0N/A * <code>DEFAULT_OPTION</code>, 0N/A * <code>YES_NO_OPTION</code>, 0N/A * <code>YES_NO_CANCEL_OPTION</code>, 0N/A * or <code>OK_CANCEL_OPTION</code> 0N/A * @exception RuntimeException if <code>newType</code> is not one of 0N/A * the legal values listed above 0N/A * @see #getOptionType 0N/A * description: The option pane's option type. 0N/A throw new RuntimeException(
"JOptionPane: option type must be one of JOptionPane.DEFAULT_OPTION, JOptionPane.YES_NO_OPTION, JOptionPane.YES_NO_CANCEL_OPTION or JOptionPane.OK_CANCEL_OPTION");
0N/A * Returns the type of options that are displayed. 0N/A * @return an integer specifying the user-selectable options 0N/A * @see #setOptionType 0N/A * Sets the input selection values for a pane that provides the user 0N/A * with a list of items to choose from. (The UI provides a widget 0N/A * for choosing one of the values.) A <code>null</code> value 0N/A * implies the user can input whatever they wish, usually by means 0N/A * of a <code>JTextField</code>. 0N/A * Sets <code>wantsInput</code> to true. Use 0N/A * <code>setInitialSelectionValue</code> to specify the initially-chosen 0N/A * value. After the pane as been enabled, <code>inputValue</code> is 0N/A * set to the value the user has selected. 0N/A * @param newValues an array of <code>Objects</code> the user to be 0N/A * (usually in a list or combo-box) from which 0N/A * the user can make a selection 0N/A * @see #setWantsInput 0N/A * @see #setInitialSelectionValue 0N/A * @see #getSelectionValues 0N/A * description: The option pane's selection values. 0N/A * Returns the input selection values. 0N/A * @return the array of <code>Objects</code> the user can select 0N/A * @see #setSelectionValues 0N/A * Sets the input value that is initially displayed as selected to the user. 0N/A * Only used if <code>wantsInput</code> is true. 0N/A * @param newValue the initially selected value 0N/A * @see #setSelectionValues 0N/A * @see #getInitialSelectionValue 0N/A * description: The option pane's initial selection value object. 0N/A * Returns the input value that is displayed as initially selected to the user. 0N/A * @return the initially selected value 0N/A * @see #setInitialSelectionValue 0N/A * @see #setSelectionValues 0N/A * Sets the input value that was selected or input by the user. 0N/A * Only used if <code>wantsInput</code> is true. Note that this method 0N/A * is invoked internally by the option pane (in response to user action) 0N/A * and should generally not be called by client programs. To set the 0N/A * input value initially displayed as selected to the user, use 0N/A * <code>setInitialSelectionValue</code>. 0N/A * @param newValue the <code>Object</code> used to set the 0N/A * value that the user specified (usually in a text field) 0N/A * @see #setSelectionValues 0N/A * @see #setInitialSelectionValue 0N/A * @see #setWantsInput 0N/A * @see #getInputValue 0N/A * description: The option pane's input value object. 0N/A * Returns the value the user has input, if <code>wantsInput</code> 0N/A * @return the <code>Object</code> the user specified, 0N/A * if it was one of the objects, or a 0N/A * <code>String</code> if it was a value typed into a 0N/A * @see #setSelectionValues 0N/A * @see #setWantsInput 0N/A * @see #setInputValue 0N/A * Returns the maximum number of characters to place on a line in a 0N/A * message. Default is to return <code>Integer.MAX_VALUE</code>. 0N/A * changed by overriding this method in a subclass. 0N/A * @return an integer giving the maximum number of characters on a line 0N/A * Sets the <code>wantsInput</code> property. 0N/A * If <code>newValue</code> is true, an input component 0N/A * (such as a text field or combo box) whose parent is 0N/A * <code>parentComponent</code> is provided to 0N/A * allow the user to input a value. If <code>getSelectionValues</code> 0N/A * returns a non-<code>null</code> array, the input value is one of the 0N/A * objects in that array. Otherwise the input value is whatever 0N/A * This is a bound property. 0N/A * @see #setSelectionValues 0N/A * @see #setInputValue 0N/A * description: Flag which allows the user to input a value. 0N/A * Returns the value of the <code>wantsInput</code> property. 0N/A * @return true if an input component will be provided 0N/A * @see #setWantsInput 0N/A * Requests that the initial value be selected, which will set 0N/A * focus to the initial value. This method 0N/A * should be invoked after the window containing the option pane 0N/A // Serialization support. 0N/A // Save the icon, if its Serializable. 0N/A // Save the message, if its Serializable. 0N/A // Save the treeModel, if its Serializable. 0N/A // Save the initialValue, if its Serializable. 0N/A // Save the value, if its Serializable. 0N/A // Save the selectionValues, if its Serializable. 0N/A // Save the inputValue, if its Serializable. 0N/A // Save the initialSelectionValue, if its Serializable. 0N/A * Returns a string representation of this <code>JOptionPane</code>. 0N/A * is intended to be used only for debugging purposes, and the 0N/A * content and format of the returned string may vary between 0N/A * implementations. The returned string may be empty but may not 0N/A * be <code>null</code>. 0N/A * @return a string representation of this <code>JOptionPane</code> 0N/A * Retrieves a method from the provided class and makes it accessible. 0N/A// Accessibility support 0N/A * Returns the <code>AccessibleContext</code> associated with this JOptionPane. 0N/A * For option panes, the <code>AccessibleContext</code> takes the form of an 0N/A * <code>AccessibleJOptionPane</code>. 0N/A * A new <code>AccessibleJOptionPane</code> instance is created if necessary. 0N/A * @return an AccessibleJOptionPane that serves as the 0N/A * AccessibleContext of this AccessibleJOptionPane 0N/A * description: The AccessibleContext associated with this option pane 0N/A * This class implements accessibility support for the 0N/A * <code>JOptionPane</code> class. It provides an implementation of the 0N/A * Java Accessibility API appropriate to option pane user-interface 0N/A * <strong>Warning:</strong> 0N/A * Serialized objects of this class will not be compatible with 0N/A * future Swing releases. The current serialization support is 0N/A * appropriate for short term storage or RMI between applications running 0N/A * the same version of Swing. As of 1.4, support for long term storage 0N/A * of all JavaBeans<sup><font size="-2">TM</font></sup> 0N/A * has been added to the <code>java.beans</code> package. 0N/A * Get the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of the object 0N/A * @see AccessibleRole 0N/A }
// inner class AccessibleJOptionPane