2722N/A * Copyright (c) 1997, 2010, 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 * The main class for creating a dialog window. You can use this class 0N/A * to create a custom dialog, or invoke the many class methods 0N/A * in {@link JOptionPane} to create a variety of standard dialogs. 0N/A * For information about creating dialogs, see 0N/A * <em>The Java Tutorial</em> section 0N/A * to Make Dialogs</a>. 2722N/A * The {@code JDialog} component contains a {@code JRootPane} 0N/A * as its only child. 2722N/A * The {@code contentPane} should be the parent of any children of the 2722N/A * As a convenience {@code add} and its variants, {@code remove} and 2722N/A * {@code setLayout} have been overridden to forward to the 2722N/A * {@code contentPane} as necessary. This means you can write: 0N/A * dialog.add(child); 0N/A * And the child will be added to the contentPane. 2722N/A * The {@code contentPane} is always non-{@code null}. 2722N/A * Attempting to set it to {@code null} generates an exception. 2722N/A * The default {@code contentPane} has a {@code BorderLayout} 0N/A * manager set on it. 0N/A * Refer to {@link javax.swing.RootPaneContainer} 2722N/A * for details on adding, removing and setting the {@code LayoutManager} 2722N/A * Please see the {@code JRootPane} documentation for a complete 2722N/A * description of the {@code contentPane}, {@code glassPane}, 2722N/A * and {@code layeredPane} components. 2722N/A * In a multi-screen environment, you can create a {@code JDialog} 0N/A * on a different screen device than its owner. See {@link java.awt.Frame} for 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> 2722N/A * has been added to the {@code java.beans} package. 0N/A * @see javax.swing.RootPaneContainer 0N/A * attribute: isContainer true 0N/A * attribute: containerDelegate getContentPane 0N/A * description: A toplevel window for creating dialog boxes. 0N/A * @author David Kloba 0N/A * @author James Gosling 0N/A * @author Scott Violet 0N/A * Key into the AppContext, used to check if should provide decorations 2722N/A * If true then calls to {@code add} and {@code setLayout} 2722N/A * will be forwarded to the {@code contentPane}. This is initially 2722N/A * false, but is set to true when the {@code JDialog} is constructed. 0N/A * @see #isRootPaneCheckingEnabled 0N/A * @see #setRootPaneCheckingEnabled 0N/A * @see javax.swing.RootPaneContainer 2722N/A * The {@code TransferHandler} for this dialog. 0N/A * Creates a modeless dialog without a title and without a specified 2722N/A * {@code Frame} owner. A shared, hidden frame will be 0N/A * set as the owner of the dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 0N/A * NOTE: This constructor does not allow you to create an unowned 2722N/A * {@code JDialog}. To create an unowned {@code JDialog} 2722N/A * you must use either the {@code JDialog(Window)} or 2722N/A * {@code JDialog(Dialog)} constructor with an argument of 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 3185N/A * Creates a modeless dialog with the specified {@code Frame} 3185N/A * as its owner and an empty title. If {@code owner} 2722N/A * is {@code null}, a shared, hidden frame will be set as the 0N/A * owner of the dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 0N/A * NOTE: This constructor does not allow you to create an unowned 2722N/A * {@code JDialog}. To create an unowned {@code JDialog} 2722N/A * you must use either the {@code JDialog(Window)} or 2722N/A * {@code JDialog(Dialog)} constructor with an argument of 2722N/A * @param owner the {@code Frame} from which the dialog is displayed 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 3185N/A * Creates a dialog with an empty title and the specified modality and 3185N/A * {@code Frame} as its owner. If {@code owner} is {@code null}, 0N/A * a shared, hidden frame will be set as the owner of the dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 0N/A * NOTE: This constructor does not allow you to create an unowned 2722N/A * {@code JDialog}. To create an unowned {@code JDialog} 2722N/A * you must use either the {@code JDialog(Window)} or 2722N/A * {@code JDialog(Dialog)} constructor with an argument of 2722N/A * @param owner the {@code Frame} from which the dialog is displayed 0N/A * @param modal specifies whether dialog blocks user input to other top-level 2722N/A * windows when shown. If {@code true}, the modality type property is set to 2722N/A * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless. 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 0N/A * Creates a modeless dialog with the specified title and 2722N/A * with the specified owner frame. If {@code owner} 2722N/A * is {@code null}, a shared, hidden frame will be set as the 0N/A * owner of the dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 0N/A * NOTE: This constructor does not allow you to create an unowned 2722N/A * {@code JDialog}. To create an unowned {@code JDialog} 2722N/A * you must use either the {@code JDialog(Window)} or 2722N/A * {@code JDialog(Dialog)} constructor with an argument of 2722N/A * @param owner the {@code Frame} from which the dialog is displayed 2722N/A * @param title the {@code String} to display in the dialog's 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 2722N/A * Creates a dialog with the specified title, owner {@code Frame} 2722N/A * and modality. If {@code owner} is {@code null}, 0N/A * a shared, hidden frame will be set as the owner of this dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * NOTE: Any popup components ({@code JComboBox}, 2722N/A * {@code JPopupMenu}, {@code JMenuBar}) 0N/A * created within a modal dialog will be forced to be lightweight. 0N/A * NOTE: This constructor does not allow you to create an unowned 2722N/A * {@code JDialog}. To create an unowned {@code JDialog} 2722N/A * you must use either the {@code JDialog(Window)} or 2722N/A * {@code JDialog(Dialog)} constructor with an argument of 2722N/A * @param owner the {@code Frame} from which the dialog is displayed 2722N/A * @param title the {@code String} to display in the dialog's 0N/A * @param modal specifies whether dialog blocks user input to other top-level 2722N/A * windows when shown. If {@code true}, the modality type property is set to 2722N/A * {@code DEFAULT_MODALITY_TYPE} otherwise the dialog is modeless 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog.ModalityType#MODELESS 0N/A * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 0N/A * Creates a dialog with the specified title, 2722N/A * owner {@code Frame}, modality and {@code GraphicsConfiguration}. 2722N/A * If {@code owner} is {@code null}, 0N/A * a shared, hidden frame will be set as the owner of this dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * NOTE: Any popup components ({@code JComboBox}, 2722N/A * {@code JPopupMenu}, {@code JMenuBar}) 0N/A * created within a modal dialog will be forced to be lightweight. 0N/A * NOTE: This constructor does not allow you to create an unowned 2722N/A * {@code JDialog}. To create an unowned {@code JDialog} 2722N/A * you must use either the {@code JDialog(Window)} or 2722N/A * {@code JDialog(Dialog)} constructor with an argument of 2722N/A * @param owner the {@code Frame} from which the dialog is displayed 2722N/A * @param title the {@code String} to display in the dialog's 0N/A * @param modal specifies whether dialog blocks user input to other top-level 2722N/A * windows when shown. If {@code true}, the modality type property is set to 2722N/A * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless. 2971N/A * @param gc the {@code GraphicsConfiguration} of the target screen device; 2971N/A * if {@code null}, the default system {@code GraphicsConfiguration} 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog.ModalityType#MODELESS 0N/A * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 3185N/A * Creates a modeless dialog with the specified {@code Dialog} 3185N/A * as its owner and an empty title. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the owner {@code Dialog} from which the dialog is displayed 2722N/A * or {@code null} if this dialog has no owner 2722N/A * @throws HeadlessException {@code if GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 3185N/A * Creates a dialog with an empty title and the specified modality and 3185N/A * {@code Dialog} as its owner. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the owner {@code Dialog} from which the dialog is displayed 2722N/A * or {@code null} if this dialog has no owner 0N/A * @param modal specifies whether dialog blocks user input to other top-level 2722N/A * windows when shown. If {@code true}, the modality type property is set to 2722N/A * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless. 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog.ModalityType#MODELESS 0N/A * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 0N/A * Creates a modeless dialog with the specified title and 0N/A * with the specified owner dialog. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the owner {@code Dialog} from which the dialog is displayed 2722N/A * or {@code null} if this dialog has no owner 2722N/A * @param title the {@code String} to display in the dialog's 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 0N/A * Creates a dialog with the specified title, modality 2722N/A * and the specified owner {@code Dialog}. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the owner {@code Dialog} from which the dialog is displayed 2722N/A * or {@code null} if this dialog has no owner 2722N/A * @param title the {@code String} to display in the dialog's 0N/A * @param modal specifies whether dialog blocks user input to other top-level 2722N/A * windows when shown. If {@code true}, the modality type property is set to 2722N/A * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog.ModalityType#MODELESS 0N/A * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 2722N/A * Creates a dialog with the specified title, owner {@code Dialog}, 2722N/A * modality and {@code GraphicsConfiguration}. 2722N/A * NOTE: Any popup components ({@code JComboBox}, 2722N/A * {@code JPopupMenu}, {@code JMenuBar}) 0N/A * created within a modal dialog will be forced to be lightweight. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the owner {@code Dialog} from which the dialog is displayed 2722N/A * or {@code null} if this dialog has no owner 2722N/A * @param title the {@code String} to display in the dialog's 0N/A * @param modal specifies whether dialog blocks user input to other top-level 2722N/A * windows when shown. If {@code true}, the modality type property is set to 2722N/A * {@code DEFAULT_MODALITY_TYPE}, otherwise the dialog is modeless 2971N/A * @param gc the {@code GraphicsConfiguration} of the target screen device; 2971N/A * if {@code null}, the default system {@code GraphicsConfiguration} 2722N/A * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog.ModalityType#MODELESS 0N/A * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 3185N/A * Creates a modeless dialog with the specified {@code Window} 3185N/A * as its owner and an empty title. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the {@code Window} from which the dialog is displayed or 2722N/A * {@code null} if this dialog has no owner 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog} 2722N/A * or {@link java.awt.Frame Frame} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner}'s {@code GraphicsConfiguration} is not from a screen device 2722N/A * @throws HeadlessException 2722N/A * when {@code GraphicsEnvironment.isHeadless()} returns {@code true} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 3185N/A * Creates a dialog with an empty title and the specified modality and 3185N/A * {@code Window} as its owner. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the {@code Window} from which the dialog is displayed or 2722N/A * {@code null} if this dialog has no owner 0N/A * @param modalityType specifies whether dialog blocks input to other 2722N/A * windows when shown. {@code null} value and unsupported modality 2722N/A * types are equivalent to {@code MODELESS} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog} 2722N/A * or {@link java.awt.Frame Frame} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner}'s {@code GraphicsConfiguration} is not from a screen device 2722N/A * @throws HeadlessException 2722N/A * when {@code GraphicsEnvironment.isHeadless()} returns {@code true} 2722N/A * @throws SecurityException 2722N/A * if the calling thread does not have permission to create modal dialogs 2722N/A * with the given {@code modalityType} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 0N/A * Creates a modeless dialog with the specified title and owner 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the {@code Window} from which the dialog is displayed or 2722N/A * {@code null} if this dialog has no owner 2722N/A * @param title the {@code String} to display in the dialog's 2722N/A * title bar or {@code null} if the dialog has no title 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog} 2722N/A * or {@link java.awt.Frame Frame} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner}'s {@code GraphicsConfiguration} is not from a screen device 2722N/A * @throws HeadlessException 2722N/A * when {@code GraphicsEnvironment.isHeadless()} returns {@code true} 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 2722N/A * Creates a dialog with the specified title, owner {@code Window} and 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the {@code Window} from which the dialog is displayed or 2722N/A * {@code null} if this dialog has no owner 2722N/A * @param title the {@code String} to display in the dialog's 2722N/A * title bar or {@code null} if the dialog has no title 2722N/A * @param modalityType specifies whether dialog blocks input to other 2722N/A * windows when shown. {@code null} value and unsupported modality 2722N/A * types are equivalent to {@code MODELESS} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog} 2722N/A * or {@link java.awt.Frame Frame} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner}'s {@code GraphicsConfiguration} is not from a screen device 2722N/A * @throws HeadlessException 2722N/A * when {@code GraphicsEnvironment.isHeadless()} returns {@code true} 2722N/A * @throws SecurityException 2722N/A * if the calling thread does not have permission to create modal dialogs 2722N/A * with the given {@code modalityType} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 2722N/A * Creates a dialog with the specified title, owner {@code Window}, 2722N/A * modality and {@code GraphicsConfiguration}. 2722N/A * NOTE: Any popup components ({@code JComboBox}, 2722N/A * {@code JPopupMenu}, {@code JMenuBar}) 0N/A * created within a modal dialog will be forced to be lightweight. 0N/A * This constructor sets the component's locale property to the value 2722N/A * returned by {@code JComponent.getDefaultLocale}. 2722N/A * @param owner the {@code Window} from which the dialog is displayed or 2722N/A * {@code null} if this dialog has no owner 2722N/A * @param title the {@code String} to display in the dialog's 2722N/A * title bar or {@code null} if the dialog has no title 0N/A * @param modalityType specifies whether dialog blocks input to other 2722N/A * windows when shown. {@code null} value and unsupported modality 2722N/A * types are equivalent to {@code MODELESS} 2722N/A * @param gc the {@code GraphicsConfiguration} of the target screen device; 2971N/A * if {@code null}, the default system {@code GraphicsConfiguration} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner} is not an instance of {@link java.awt.Dialog Dialog} 2722N/A * or {@link java.awt.Frame Frame} 2722N/A * @throws IllegalArgumentException 2722N/A * if the {@code owner}'s {@code GraphicsConfiguration} is not from a screen device 2722N/A * @throws HeadlessException 2722N/A * when {@code GraphicsEnvironment.isHeadless()} returns {@code true} 2722N/A * @throws SecurityException 2722N/A * if the calling thread does not have permission to create modal dialogs 2722N/A * with the given {@code modalityType} 0N/A * @see java.awt.Dialog.ModalityType 0N/A * @see java.awt.Dialog#setModal 0N/A * @see java.awt.Dialog#setModalityType 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * @see JComponent#getDefaultLocale 2722N/A * Called by the constructors to init the {@code JDialog} properly. 0N/A * Called by the constructor methods to create the default 0N/A // NOTE: this uses setOpaque vs LookAndFeel.installProperty as there 0N/A // is NO reason for the RootPane not to be opaque. For painting to 0N/A // work the contentPane must be opaque, therefor the RootPane can 0N/A * Handles window events depending on the state of the 2722N/A * {@code defaultCloseOperation} property. 0N/A * @see #setDefaultCloseOperation 0N/A * Sets the operation that will happen by default when 0N/A * the user initiates a "close" on this dialog. 0N/A * You must specify one of the following choices: 2722N/A * <li>{@code DO_NOTHING_ON_CLOSE} 2722N/A * (defined in {@code WindowConstants}): 0N/A * Don't do anything; require the 2722N/A * program to handle the operation in the {@code windowClosing} 2722N/A * method of a registered {@code WindowListener} object. 2722N/A * <li>{@code HIDE_ON_CLOSE} 2722N/A * (defined in {@code WindowConstants}): 0N/A * Automatically hide the dialog after 2722N/A * invoking any registered {@code WindowListener} 2722N/A * <li>{@code DISPOSE_ON_CLOSE} 2722N/A * (defined in {@code WindowConstants}): 0N/A * Automatically hide and dispose the 2722N/A * dialog after invoking any registered {@code WindowListener} 2722N/A * The value is set to {@code HIDE_ON_CLOSE} by default. Changes 0N/A * to the value of this property cause the firing of a property 0N/A * change event, with property name "defaultCloseOperation". 0N/A * <b>Note</b>: When the last displayable window within the 0N/A * Java virtual machine (VM) is disposed of, the VM may 0N/A * AWT Threading Issues</a> for more information. 0N/A * @param operation the operation which should be performed when the 0N/A * user closes the dialog 0N/A * @throws IllegalArgumentException if defaultCloseOperation value 0N/A * isn't one of the above valid values 0N/A * @see #addWindowListener 0N/A * @see #getDefaultCloseOperation 0N/A * @see WindowConstants 0N/A * enum: DO_NOTHING_ON_CLOSE WindowConstants.DO_NOTHING_ON_CLOSE 0N/A * HIDE_ON_CLOSE WindowConstants.HIDE_ON_CLOSE 0N/A * DISPOSE_ON_CLOSE WindowConstants.DISPOSE_ON_CLOSE 0N/A * description: The dialog's default close operation. 0N/A * Returns the operation which occurs when the user 0N/A * initiates a "close" on this dialog. 0N/A * @return an integer indicating the window-close operation 0N/A * @see #setDefaultCloseOperation 0N/A * Sets the {@code transferHandler} property, which is a mechanism to 0N/A * support transfer of data into this component. Use {@code null} 0N/A * if the component does not support data transfer operations. 0N/A * If the system property {@code suppressSwingDropSupport} is {@code false} 0N/A * (the default) and the current drop target on this component is either 0N/A * {@code null} or not a user-set drop target, this method will change the 0N/A * drop target as follows: If {@code newHandler} is {@code null} it will 0N/A * clear the drop target. If not {@code null} it will install a new 0N/A * {@code DropTarget}. 0N/A * Note: When used with {@code JDialog}, {@code TransferHandler} only 0N/A * provides data import capability, as the data export related methods 0N/A * are currently typed to {@code JComponent}. 0N/A * How to Use Drag and Drop and Data Transfer</a>, a section in 0N/A * <em>The Java Tutorial</em>, for more information. 0N/A * @param newHandler the new {@code TransferHandler} 0N/A * @see TransferHandler 0N/A * @see #getTransferHandler 0N/A * @see java.awt.Component#setDropTarget 0N/A * description: Mechanism for transfer of data into the component 2722N/A * Gets the {@code transferHandler} property. 2722N/A * @return the value of the {@code transferHandler} property 0N/A * @see TransferHandler 0N/A * @see #setTransferHandler 2722N/A * Calls {@code paint(g)}. This method was overridden to 0N/A * prevent an unnecessary call to clear the background. 2722N/A * @param g the {@code Graphics} context in which to paint 0N/A * Sets the menubar for this dialog. 0N/A * @param menu the menubar being placed in the dialog 0N/A * description: The menubar for accessing pulldown menus from this dialog. 0N/A * Returns the menubar set on this dialog. 2722N/A * Returns whether calls to {@code add} and 2722N/A * {@code setLayout} are forwarded to the {@code contentPane}. 2722N/A * @return true if {@code add} and {@code setLayout} 0N/A * are fowarded; false otherwise 0N/A * @see #setRootPaneCheckingEnabled 0N/A * @see javax.swing.RootPaneContainer 2722N/A * Sets whether calls to {@code add} and 2722N/A * {@code setLayout} are forwarded to the {@code contentPane}. 2722N/A * @param enabled true if {@code add} and {@code setLayout} 0N/A * are forwarded, false if they should operate directly on the 0N/A * @see #isRootPaneCheckingEnabled 0N/A * @see javax.swing.RootPaneContainer 0N/A * description: Whether the add and setLayout methods are forwarded 2722N/A * Adds the specified child {@code Component}. 0N/A * This method is overridden to conditionally forward calls to the 2722N/A * By default, children are added to the {@code contentPane} instead 0N/A * of the frame, refer to {@link javax.swing.RootPaneContainer} for 0N/A * @param comp the component to be enhanced 0N/A * @param constraints the constraints to be respected 0N/A * @param index the index 2722N/A * @throws IllegalArgumentException if {@code index} is invalid 2722N/A * @throws IllegalArgumentException if adding the container's parent 2722N/A * @throws IllegalArgumentException if adding a window to a container 0N/A * @see #setRootPaneCheckingEnabled 0N/A * @see javax.swing.RootPaneContainer 0N/A * Removes the specified component from the container. If 2722N/A * {@code comp} is not the {@code rootPane}, this will forward 2722N/A * the call to the {@code contentPane}. This will do nothing if 2722N/A * {@code comp} is not a child of the {@code JDialog} or 0N/A * @param comp the component to be removed 2722N/A * @throws NullPointerException if {@code comp} is null 0N/A * @see javax.swing.RootPaneContainer 2722N/A * Sets the {@code LayoutManager}. 0N/A * Overridden to conditionally forward the call to the 0N/A * Refer to {@link javax.swing.RootPaneContainer} for 2722N/A * @param manager the {@code LayoutManager} 0N/A * @see #setRootPaneCheckingEnabled 0N/A * @see javax.swing.RootPaneContainer 2722N/A * Returns the {@code rootPane} object for this dialog. 0N/A * @see RootPaneContainer#getRootPane 2722N/A * Sets the {@code rootPane} property. 0N/A * This method is called by the constructor. 2722N/A * @param root the {@code rootPane} object for this dialog 0N/A * description: the RootPane object for this dialog. 2722N/A * Returns the {@code contentPane} object for this dialog. 2722N/A * @return the {@code contentPane} property 0N/A * @see #setContentPane 0N/A * @see RootPaneContainer#getContentPane 2722N/A * Sets the {@code contentPane} property. 0N/A * This method is called by the constructor. 2722N/A * Swing's painting architecture requires an opaque {@code JComponent} 0N/A * in the containment hiearchy. This is typically provided by the 0N/A * content pane. If you replace the content pane it is recommended you 2722N/A * replace it with an opaque {@code JComponent}. 2722N/A * @param contentPane the {@code contentPane} object for this dialog 2722N/A * @throws java.awt.IllegalComponentStateException (a runtime 2722N/A * exception) if the content pane parameter is {@code null} 0N/A * @see #getContentPane 0N/A * @see RootPaneContainer#setContentPane 0N/A * description: The client area of the dialog where child 0N/A * components are normally inserted. 2722N/A * Returns the {@code layeredPane} object for this dialog. 2722N/A * @return the {@code layeredPane} property 0N/A * @see #setLayeredPane 0N/A * @see RootPaneContainer#getLayeredPane 2722N/A * Sets the {@code layeredPane} property. 0N/A * This method is called by the constructor. 2722N/A * @param layeredPane the new {@code layeredPane} property 2722N/A * @throws java.awt.IllegalComponentStateException (a runtime 0N/A * exception) if the layered pane parameter is null 0N/A * @see #getLayeredPane 0N/A * @see RootPaneContainer#setLayeredPane 0N/A * description: The pane which holds the various dialog layers. 2722N/A * Returns the {@code glassPane} object for this dialog. 2722N/A * @return the {@code glassPane} property 0N/A * @see #setGlassPane 0N/A * @see RootPaneContainer#getGlassPane 2722N/A * Sets the {@code glassPane} property. 0N/A * This method is called by the constructor. 2722N/A * @param glassPane the {@code glassPane} object for this dialog 0N/A * @see #getGlassPane 0N/A * @see RootPaneContainer#setGlassPane 0N/A * description: A transparent pane used for menu rendering. 0N/A * Repaints the specified rectangle of this component within 2722N/A * {@code time} milliseconds. Refer to {@code RepaintManager} 0N/A * for details on how the repaint is handled. 0N/A * @param time maximum time in milliseconds before update 0N/A * @param x the <i>x</i> coordinate 0N/A * @param y the <i>y</i> coordinate 0N/A * @param width the width 0N/A * @param height the height 0N/A * @see RepaintManager 2722N/A * Provides a hint as to whether or not newly created {@code JDialog}s 0N/A * should have their Window decorations (such as borders, widgets to 0N/A * close the window, title...) provided by the current look 2722N/A * and feel. If {@code defaultLookAndFeelDecorated} is true, 2722N/A * the current {@code LookAndFeel} supports providing window 0N/A * decorations, and the current window manager supports undecorated 2722N/A * windows, then newly created {@code JDialog}s will have their 2722N/A * Window decorations provided by the current {@code LookAndFeel}. 2722N/A * Otherwise, newly created {@code JDialog}s will have their 0N/A * Window decorations provided by the current window manager. 0N/A * You can get the same effect on a single JDialog by doing the following: 0N/A * JDialog dialog = new JDialog(); 0N/A * dialog.setUndecorated(true); 0N/A * dialog.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG); 0N/A * @param defaultLookAndFeelDecorated A hint as to whether or not current 0N/A * look and feel should provide window decorations 0N/A * @see javax.swing.LookAndFeel#getSupportsWindowDecorations 2722N/A * Returns true if newly created {@code JDialog}s should have their 0N/A * Window decorations provided by the current look and feel. This is only 0N/A * a hint, as certain look and feels may not support this feature. 0N/A * @return true if look and feel should provide Window decorations. 2722N/A * Returns a string representation of this {@code JDialog}. 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 2722N/A * @return a string representation of this {@code JDialog}. 0N/A// Accessibility support 0N/A * Gets the AccessibleContext associated with this JDialog. 0N/A * For JDialogs, the AccessibleContext takes the form of an 0N/A * AccessibleJDialog. 0N/A * A new AccessibleJDialog instance is created if necessary. 0N/A * @return an AccessibleJDialog that serves as the 0N/A * AccessibleContext of this JDialog 0N/A * This class implements accessibility support for the 2722N/A * {@code JDialog} class. It provides an implementation of the 0N/A * Java Accessibility API appropriate to dialog user-interface 0N/A // AccessibleContext methods 0N/A * Get the accessible name of this object. 0N/A * @return the localized name of the object -- can be null if this 0N/A * object does not have a name 0N/A * Get the state of this object. 0N/A * @return an instance of AccessibleStateSet containing the current 0N/A * state set of the object 0N/A * @see AccessibleState 0N/A }
// inner class AccessibleJDialog