< prev index next >

src/java.desktop/share/classes/java/awt/Dialog.java

Print this page

        

*** 44,92 **** * A Dialog is a top-level window with a title and a border * that is typically used to take some form of input from the user. * * The size of the dialog includes any area designated for the * border. The dimensions of the border area can be obtained ! * using the <code>getInsets</code> method, however, since * these dimensions are platform-dependent, a valid insets * value cannot be obtained until the dialog is made displayable ! * by either calling <code>pack</code> or <code>show</code>. * Since the border area is included in the overall size of the * dialog, the border effectively obscures a portion of the dialog, * constraining the area available for rendering and/or displaying * subcomponents to the rectangle which has an upper-left corner ! * location of <code>(insets.left, insets.top)</code>, and has a size of ! * <code>width - (insets.left + insets.right)</code> by ! * <code>height - (insets.top + insets.bottom)</code>. * <p> ! * The default layout for a dialog is <code>BorderLayout</code>. * <p> * A dialog may have its native decorations (i.e. Frame &amp; Titlebar) turned off ! * with <code>setUndecorated</code>. This can only be done while the dialog * is not {@link Component#isDisplayable() displayable}. * <p> * A dialog may have another window as its owner when it's constructed. When * the owner window of a visible dialog is minimized, the dialog will * automatically be hidden from the user. When the owner window is subsequently * restored, the dialog is made visible to the user again. * <p> ! * In a multi-screen environment, you can create a <code>Dialog</code> * on a different screen device than its owner. See {@link java.awt.Frame} for * more information. * <p> * A dialog can be either modeless (the default) or modal. A modal * dialog is one which blocks input to some other top-level windows * in the application, except for any windows created with the dialog * as their owner. See <a href="doc-files/Modality.html">AWT Modality</a> * specification for details. * <p> * Dialogs are capable of generating the following ! * <code>WindowEvents</code>: ! * <code>WindowOpened</code>, <code>WindowClosing</code>, ! * <code>WindowClosed</code>, <code>WindowActivated</code>, ! * <code>WindowDeactivated</code>, <code>WindowGainedFocus</code>, ! * <code>WindowLostFocus</code>. * * @see WindowEvent * @see Window#addWindowListener * * @author Sami Shaio --- 44,92 ---- * A Dialog is a top-level window with a title and a border * that is typically used to take some form of input from the user. * * The size of the dialog includes any area designated for the * border. The dimensions of the border area can be obtained ! * using the {@code getInsets} method, however, since * these dimensions are platform-dependent, a valid insets * value cannot be obtained until the dialog is made displayable ! * by either calling {@code pack} or {@code show}. * Since the border area is included in the overall size of the * dialog, the border effectively obscures a portion of the dialog, * constraining the area available for rendering and/or displaying * subcomponents to the rectangle which has an upper-left corner ! * location of {@code (insets.left, insets.top)}, and has a size of ! * {@code width - (insets.left + insets.right)} by ! * {@code height - (insets.top + insets.bottom)}. * <p> ! * The default layout for a dialog is {@code BorderLayout}. * <p> * A dialog may have its native decorations (i.e. Frame &amp; Titlebar) turned off ! * with {@code setUndecorated}. This can only be done while the dialog * is not {@link Component#isDisplayable() displayable}. * <p> * A dialog may have another window as its owner when it's constructed. When * the owner window of a visible dialog is minimized, the dialog will * automatically be hidden from the user. When the owner window is subsequently * restored, the dialog is made visible to the user again. * <p> ! * In a multi-screen environment, you can create a {@code Dialog} * on a different screen device than its owner. See {@link java.awt.Frame} for * more information. * <p> * A dialog can be either modeless (the default) or modal. A modal * dialog is one which blocks input to some other top-level windows * in the application, except for any windows created with the dialog * as their owner. See <a href="doc-files/Modality.html">AWT Modality</a> * specification for details. * <p> * Dialogs are capable of generating the following ! * {@code WindowEvents}: ! * {@code WindowOpened}, {@code WindowClosing}, ! * {@code WindowClosed}, {@code WindowActivated}, ! * {@code WindowDeactivated}, {@code WindowGainedFocus}, ! * {@code WindowLostFocus}. * * @see WindowEvent * @see Window#addWindowListener * * @author Sami Shaio
*** 115,125 **** /** * This field indicates whether the dialog is undecorated. * This property can only be changed while the dialog is not displayable. ! * <code>undecorated</code> will be true if the dialog is * undecorated, otherwise it will be false. * * @serial * @see #setUndecorated(boolean) * @see #isUndecorated() --- 115,125 ---- /** * This field indicates whether the dialog is undecorated. * This property can only be changed while the dialog is not displayable. ! * {@code undecorated} will be true if the dialog is * undecorated, otherwise it will be false. * * @serial * @see #setUndecorated(boolean) * @see #isUndecorated()
*** 132,194 **** /** * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type * of modality; this is called the "scope of blocking". The ! * <code>ModalityType</code> enum specifies modal types and their * associated scopes. * * @see Dialog#getModalityType * @see Dialog#setModalityType * @see Toolkit#isModalityTypeSupported * * @since 1.6 */ public static enum ModalityType { /** ! * <code>MODELESS</code> dialog doesn't block any top-level windows. */ MODELESS, /** ! * A <code>DOCUMENT_MODAL</code> dialog blocks input to all top-level windows * from the same document except those from its own child hierarchy. * A document is a top-level window without an owner. It may contain child * windows that, together with the top-level window are treated as a single * solid document. Since every top-level window must belong to some * document, its root can be found as the top-nearest window without an owner. */ DOCUMENT_MODAL, /** ! * An <code>APPLICATION_MODAL</code> dialog blocks all top-level windows * from the same Java application except those from its own child hierarchy. * If there are several applets launched in a browser, they can be * treated either as separate applications or a single one. This behavior * is implementation-dependent. */ APPLICATION_MODAL, /** ! * A <code>TOOLKIT_MODAL</code> dialog blocks all top-level windows run * from the same toolkit except those from its own child hierarchy. If there * are several applets launched in a browser, all of them run with the same * toolkit; thus, a toolkit-modal dialog displayed by an applet may affect * other applets and all windows of the browser instance which embeds the * Java runtime environment for this toolkit. ! * Special <code>AWTPermission</code> "toolkitModality" must be granted to use ! * toolkit-modal dialogs. If a <code>TOOLKIT_MODAL</code> dialog is being created ! * and this permission is not granted, a <code>SecurityException</code> will be * thrown, and no dialog will be created. If a modality type is being changed ! * to <code>TOOLKIT_MODAL</code> and this permission is not granted, a ! * <code>SecurityException</code> will be thrown, and the modality type will * be left unchanged. */ TOOLKIT_MODAL }; /** * Default modality type for modal dialogs. The default modality type is ! * <code>APPLICATION_MODAL</code>. Calling the oldstyle <code>setModal(true)</code> ! * is equal to <code>setModalityType(DEFAULT_MODALITY_TYPE)</code>. * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * * @since 1.6 --- 132,194 ---- /** * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type * of modality; this is called the "scope of blocking". The ! * {@code ModalityType} enum specifies modal types and their * associated scopes. * * @see Dialog#getModalityType * @see Dialog#setModalityType * @see Toolkit#isModalityTypeSupported * * @since 1.6 */ public static enum ModalityType { /** ! * {@code MODELESS} dialog doesn't block any top-level windows. */ MODELESS, /** ! * A {@code DOCUMENT_MODAL} dialog blocks input to all top-level windows * from the same document except those from its own child hierarchy. * A document is a top-level window without an owner. It may contain child * windows that, together with the top-level window are treated as a single * solid document. Since every top-level window must belong to some * document, its root can be found as the top-nearest window without an owner. */ DOCUMENT_MODAL, /** ! * An {@code APPLICATION_MODAL} dialog blocks all top-level windows * from the same Java application except those from its own child hierarchy. * If there are several applets launched in a browser, they can be * treated either as separate applications or a single one. This behavior * is implementation-dependent. */ APPLICATION_MODAL, /** ! * A {@code TOOLKIT_MODAL} dialog blocks all top-level windows run * from the same toolkit except those from its own child hierarchy. If there * are several applets launched in a browser, all of them run with the same * toolkit; thus, a toolkit-modal dialog displayed by an applet may affect * other applets and all windows of the browser instance which embeds the * Java runtime environment for this toolkit. ! * Special {@code AWTPermission} "toolkitModality" must be granted to use ! * toolkit-modal dialogs. If a {@code TOOLKIT_MODAL} dialog is being created ! * and this permission is not granted, a {@code SecurityException} will be * thrown, and no dialog will be created. If a modality type is being changed ! * to {@code TOOLKIT_MODAL} and this permission is not granted, a ! * {@code SecurityException} will be thrown, and the modality type will * be left unchanged. */ TOOLKIT_MODAL }; /** * Default modality type for modal dialogs. The default modality type is ! * {@code APPLICATION_MODAL}. Calling the oldstyle {@code setModal(true)} ! * is equal to {@code setModalityType(DEFAULT_MODALITY_TYPE)}. * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * * @since 1.6
*** 243,266 **** /** * No modal exclusion. */ NO_EXCLUDE, /** ! * <code>APPLICATION_EXCLUDE</code> indicates that a top-level window * won't be blocked by any application-modal dialogs. Also, it isn't * blocked by document-modal dialogs from outside of its child hierarchy. */ APPLICATION_EXCLUDE, /** ! * <code>TOOLKIT_EXCLUDE</code> indicates that a top-level window * won't be blocked by application-modal or toolkit-modal dialogs. Also, * it isn't blocked by document-modal dialogs from outside of its * child hierarchy. ! * The "toolkitModality" <code>AWTPermission</code> must be granted * for this exclusion. If an exclusion property is being changed to ! * <code>TOOLKIT_EXCLUDE</code> and this permission is not granted, a ! * <code>SecurityException</code> will be thrown, and the exclusion * property will be left unchanged. */ TOOLKIT_EXCLUDE }; --- 243,266 ---- /** * No modal exclusion. */ NO_EXCLUDE, /** ! * {@code APPLICATION_EXCLUDE} indicates that a top-level window * won't be blocked by any application-modal dialogs. Also, it isn't * blocked by document-modal dialogs from outside of its child hierarchy. */ APPLICATION_EXCLUDE, /** ! * {@code TOOLKIT_EXCLUDE} indicates that a top-level window * won't be blocked by application-modal or toolkit-modal dialogs. Also, * it isn't blocked by document-modal dialogs from outside of its * child hierarchy. ! * The "toolkitModality" {@code AWTPermission} must be granted * for this exclusion. If an exclusion property is being changed to ! * {@code TOOLKIT_EXCLUDE} and this permission is not granted, a ! * {@code SecurityException} will be thrown, and the exclusion * property will be left unchanged. */ TOOLKIT_EXCLUDE };
*** 311,352 **** * JDK 1.1 serialVersionUID */ private static final long serialVersionUID = 5920926903803293709L; /** ! * Constructs an initially invisible, modeless <code>Dialog</code> with ! * the specified owner <code>Frame</code> and an empty title. * ! * @param owner the owner of the dialog or <code>null</code> if * this dialog has no owner ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize * @see Component#setVisible */ public Dialog(Frame owner) { this(owner, "", false); } /** ! * Constructs an initially invisible <code>Dialog</code> with the specified ! * owner <code>Frame</code> and modality and an empty title. * ! * @param owner the owner of the dialog or <code>null</code> if * this dialog has no owner * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If <code>false</code>, the dialog is <code>MODELESS</code>; ! * if <code>true</code>, the modality type property is set to ! * <code>DEFAULT_MODALITY_TYPE</code> ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal --- 311,352 ---- * JDK 1.1 serialVersionUID */ private static final long serialVersionUID = 5920926903803293709L; /** ! * Constructs an initially invisible, modeless {@code Dialog} with ! * the specified owner {@code Frame} and an empty title. * ! * @param owner the owner of the dialog or {@code null} if * this dialog has no owner ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize * @see Component#setVisible */ public Dialog(Frame owner) { this(owner, "", false); } /** ! * Constructs an initially invisible {@code Dialog} with the specified ! * owner {@code Frame} and modality and an empty title. * ! * @param owner the owner of the dialog or {@code null} if * this dialog has no owner * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If {@code false}, the dialog is {@code MODELESS}; ! * if {@code true}, the modality type property is set to ! * {@code DEFAULT_MODALITY_TYPE} ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal
*** 356,401 **** public Dialog(Frame owner, boolean modal) { this(owner, "", modal); } /** ! * Constructs an initially invisible, modeless <code>Dialog</code> with ! * the specified owner <code>Frame</code> and title. * ! * @param owner the owner of the dialog or <code>null</code> if * this dialog has no owner ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title ! * @exception IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize * @see Component#setVisible */ public Dialog(Frame owner, String title) { this(owner, title, false); } /** ! * Constructs an initially invisible <code>Dialog</code> with the ! * specified owner <code>Frame</code>, title and modality. * ! * @param owner the owner of the dialog or <code>null</code> if * this dialog has no owner ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If <code>false</code>, the dialog is <code>MODELESS</code>; ! * if <code>true</code>, the modality type property is set to ! * <code>DEFAULT_MODALITY_TYPE</code> ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal --- 356,401 ---- public Dialog(Frame owner, boolean modal) { this(owner, "", modal); } /** ! * Constructs an initially invisible, modeless {@code Dialog} with ! * the specified owner {@code Frame} and title. * ! * @param owner the owner of the dialog or {@code null} if * this dialog has no owner ! * @param title the title of the dialog or {@code null} if this dialog * has no title ! * @exception IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize * @see Component#setVisible */ public Dialog(Frame owner, String title) { this(owner, title, false); } /** ! * Constructs an initially invisible {@code Dialog} with the ! * specified owner {@code Frame}, title and modality. * ! * @param owner the owner of the dialog or {@code null} if * this dialog has no owner ! * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If {@code false}, the dialog is {@code MODELESS}; ! * if {@code true}, the modality type property is set to ! * {@code DEFAULT_MODALITY_TYPE} ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal
*** 407,433 **** public Dialog(Frame owner, String title, boolean modal) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS); } /** ! * Constructs an initially invisible <code>Dialog</code> with the specified owner ! * <code>Frame</code>, title, modality, and <code>GraphicsConfiguration</code>. ! * @param owner the owner of the dialog or <code>null</code> if this dialog * has no owner ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If <code>false</code>, the dialog is <code>MODELESS</code>; ! * if <code>true</code>, the modality type property is set to ! * <code>DEFAULT_MODALITY_TYPE</code> ! * @param gc the <code>GraphicsConfiguration</code> of the target screen device; ! * if <code>null</code>, the default system <code>GraphicsConfiguration</code> * is assumed ! * @exception java.lang.IllegalArgumentException if <code>gc</code> * is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal --- 407,433 ---- public Dialog(Frame owner, String title, boolean modal) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS); } /** ! * Constructs an initially invisible {@code Dialog} with the specified owner ! * {@code Frame}, title, modality, and {@code GraphicsConfiguration}. ! * @param owner the owner of the dialog or {@code null} if this dialog * has no owner ! * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If {@code false}, the dialog is {@code MODELESS}; ! * if {@code true}, the modality type property is set to ! * {@code DEFAULT_MODALITY_TYPE} ! * @param gc the {@code GraphicsConfiguration} of the target screen device; ! * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed ! * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal
*** 441,502 **** GraphicsConfiguration gc) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS, gc); } /** ! * Constructs an initially invisible, modeless <code>Dialog</code> with ! * the specified owner <code>Dialog</code> and an empty title. * ! * @param owner the owner of the dialog or <code>null</code> if this * dialog has no owner ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */ public Dialog(Dialog owner) { this(owner, "", false); } /** ! * Constructs an initially invisible, modeless <code>Dialog</code> ! * with the specified owner <code>Dialog</code> and title. * ! * @param owner the owner of the dialog or <code>null</code> if this * has no owner ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */ public Dialog(Dialog owner, String title) { this(owner, title, false); } /** ! * Constructs an initially invisible <code>Dialog</code> with the ! * specified owner <code>Dialog</code>, title, and modality. * ! * @param owner the owner of the dialog or <code>null</code> if this * dialog has no owner ! * @param title the title of the dialog or <code>null</code> if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If <code>false</code>, the dialog is <code>MODELESS</code>; ! * if <code>true</code>, the modality type property is set to ! * <code>DEFAULT_MODALITY_TYPE</code> ! * @exception IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal --- 441,502 ---- GraphicsConfiguration gc) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS, gc); } /** ! * Constructs an initially invisible, modeless {@code Dialog} with ! * the specified owner {@code Dialog} and an empty title. * ! * @param owner the owner of the dialog or {@code null} if this * dialog has no owner ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */ public Dialog(Dialog owner) { this(owner, "", false); } /** ! * Constructs an initially invisible, modeless {@code Dialog} ! * with the specified owner {@code Dialog} and title. * ! * @param owner the owner of the dialog or {@code null} if this * has no owner ! * @param title the title of the dialog or {@code null} if this dialog * has no title ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */ public Dialog(Dialog owner, String title) { this(owner, title, false); } /** ! * Constructs an initially invisible {@code Dialog} with the ! * specified owner {@code Dialog}, title, and modality. * ! * @param owner the owner of the dialog or {@code null} if this * dialog has no owner ! * @param title the title of the dialog or {@code null} if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If {@code false}, the dialog is {@code MODELESS}; ! * if {@code true}, the modality type property is set to ! * {@code DEFAULT_MODALITY_TYPE} ! * @exception IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal
*** 508,536 **** public Dialog(Dialog owner, String title, boolean modal) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS); } /** ! * Constructs an initially invisible <code>Dialog</code> with the ! * specified owner <code>Dialog</code>, title, modality and ! * <code>GraphicsConfiguration</code>. * ! * @param owner the owner of the dialog or <code>null</code> if this * dialog has no owner ! * @param title the title of the dialog or <code>null</code> if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If <code>false</code>, the dialog is <code>MODELESS</code>; ! * if <code>true</code>, the modality type property is set to ! * <code>DEFAULT_MODALITY_TYPE</code> ! * @param gc the <code>GraphicsConfiguration</code> of the target screen device; ! * if <code>null</code>, the default system <code>GraphicsConfiguration</code> * is assumed ! * @exception java.lang.IllegalArgumentException if <code>gc</code> * is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal --- 508,536 ---- public Dialog(Dialog owner, String title, boolean modal) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS); } /** ! * Constructs an initially invisible {@code Dialog} with the ! * specified owner {@code Dialog}, title, modality and ! * {@code GraphicsConfiguration}. * ! * @param owner the owner of the dialog or {@code null} if this * dialog has no owner ! * @param title the title of the dialog or {@code null} if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level ! * windows when shown. If {@code false}, the dialog is {@code MODELESS}; ! * if {@code true}, the modality type property is set to ! * {@code DEFAULT_MODALITY_TYPE} ! * @param gc the {@code GraphicsConfiguration} of the target screen device; ! * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed ! * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog#setModal
*** 545,623 **** GraphicsConfiguration gc) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS, gc); } /** ! * Constructs an initially invisible, modeless <code>Dialog</code> with the ! * specified owner <code>Window</code> and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or <code>null</code> * ! * @exception java.lang.IllegalArgumentException if the <code>owner</code> * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.GraphicsEnvironment#isHeadless * * @since 1.6 */ public Dialog(Window owner) { this(owner, "", ModalityType.MODELESS); } /** ! * Constructs an initially invisible, modeless <code>Dialog</code> with ! * the specified owner <code>Window</code> and title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or <code>null</code> ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title * ! * @exception java.lang.IllegalArgumentException if the <code>owner</code> * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * * @see java.awt.GraphicsEnvironment#isHeadless * * @since 1.6 */ public Dialog(Window owner, String title) { this(owner, title, ModalityType.MODELESS); } /** ! * Constructs an initially invisible <code>Dialog</code> with the ! * specified owner <code>Window</code> and modality and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or <code>null</code> * @param modalityType specifies whether dialog blocks input to other ! * windows when shown. <code>null</code> value and unsupported modality ! * types are equivalent to <code>MODELESS</code> * ! * @exception java.lang.IllegalArgumentException if the <code>owner</code> * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given <code>modalityType</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * @see java.awt.Dialog#setModalityType * @see java.awt.GraphicsEnvironment#isHeadless --- 545,623 ---- GraphicsConfiguration gc) { this(owner, title, modal ? DEFAULT_MODALITY_TYPE : ModalityType.MODELESS, gc); } /** ! * Constructs an initially invisible, modeless {@code Dialog} with the ! * specified owner {@code Window} and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or {@code null} * ! * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * * @since 1.6 */ public Dialog(Window owner) { this(owner, "", ModalityType.MODELESS); } /** ! * Constructs an initially invisible, modeless {@code Dialog} with ! * the specified owner {@code Window} and title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or {@code null} ! * @param title the title of the dialog or {@code null} if this dialog * has no title * ! * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * * @since 1.6 */ public Dialog(Window owner, String title) { this(owner, title, ModalityType.MODELESS); } /** ! * Constructs an initially invisible {@code Dialog} with the ! * specified owner {@code Window} and modality and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or {@code null} * @param modalityType specifies whether dialog blocks input to other ! * windows when shown. {@code null} value and unsupported modality ! * types are equivalent to {@code MODELESS} * ! * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * @see java.awt.Dialog#setModalityType * @see java.awt.GraphicsEnvironment#isHeadless
*** 628,658 **** public Dialog(Window owner, ModalityType modalityType) { this(owner, "", modalityType); } /** ! * Constructs an initially invisible <code>Dialog</code> with the ! * specified owner <code>Window</code>, title and modality. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or <code>null</code> ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other ! * windows when shown. <code>null</code> value and unsupported modality ! * types are equivalent to <code>MODELESS</code> * ! * @exception java.lang.IllegalArgumentException if the <code>owner</code> * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the <code>owner</code>'s ! * <code>GraphicsConfiguration</code> is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given <code>modalityType</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * @see java.awt.Dialog#setModalityType * @see java.awt.GraphicsEnvironment#isHeadless --- 628,658 ---- public Dialog(Window owner, ModalityType modalityType) { this(owner, "", modalityType); } /** ! * Constructs an initially invisible {@code Dialog} with the ! * specified owner {@code Window}, title and modality. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or {@code null} ! * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other ! * windows when shown. {@code null} value and unsupported modality ! * types are equivalent to {@code MODELESS} * ! * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if the {@code owner}'s ! * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * @see java.awt.Dialog#setModalityType * @see java.awt.GraphicsEnvironment#isHeadless
*** 675,709 **** SunToolkit.checkAndSetPolicy(this); initialized = true; } /** ! * Constructs an initially invisible <code>Dialog</code> with the ! * specified owner <code>Window</code>, title, modality and ! * <code>GraphicsConfiguration</code>. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or <code>null</code> ! * @param title the title of the dialog or <code>null</code> if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other ! * windows when shown. <code>null</code> value and unsupported modality ! * types are equivalent to <code>MODELESS</code> ! * @param gc the <code>GraphicsConfiguration</code> of the target screen device; ! * if <code>null</code>, the default system <code>GraphicsConfiguration</code> * is assumed * ! * @exception java.lang.IllegalArgumentException if the <code>owner</code> * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if <code>gc</code> * is not from a screen device * @exception HeadlessException when ! * <code>GraphicsEnvironment.isHeadless()</code> returns <code>true</code> * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given <code>modalityType</code> * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * @see java.awt.Dialog#setModalityType * @see java.awt.GraphicsEnvironment#isHeadless --- 675,709 ---- SunToolkit.checkAndSetPolicy(this); initialized = true; } /** ! * Constructs an initially invisible {@code Dialog} with the ! * specified owner {@code Window}, title, modality and ! * {@code GraphicsConfiguration}. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any ! * of their descendants or {@code null} ! * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other ! * windows when shown. {@code null} value and unsupported modality ! * types are equivalent to {@code MODELESS} ! * @param gc the {@code GraphicsConfiguration} of the target screen device; ! * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed * ! * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} ! * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when ! * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal * @see java.awt.Dialog#setModalityType * @see java.awt.GraphicsEnvironment#isHeadless
*** 764,775 **** * Indicates whether the dialog is modal. * <p> * This method is obsolete and is kept for backwards compatibility only. * Use {@link #getModalityType getModalityType()} instead. * ! * @return <code>true</code> if this dialog window is modal; ! * <code>false</code> otherwise * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#setModal * @see java.awt.Dialog#getModalityType --- 764,775 ---- * Indicates whether the dialog is modal. * <p> * This method is obsolete and is kept for backwards compatibility only. * Use {@link #getModalityType getModalityType()} instead. * ! * @return {@code true} if this dialog window is modal; ! * {@code false} otherwise * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#setModal * @see java.awt.Dialog#getModalityType
*** 790,803 **** * <p> * Note: changing modality of the visible dialog may have no effect * until it is hidden and then shown again. * * @param modal specifies whether dialog blocks input to other windows ! * when shown; calling to <code>setModal(true)</code> is equivalent to ! * <code>setModalityType(Dialog.DEFAULT_MODALITY_TYPE)</code>, and ! * calling to <code>setModal(false)</code> is equivalent to ! * <code>setModalityType(Dialog.ModalityType.MODELESS)</code> * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#isModal * @see java.awt.Dialog#getModalityType --- 790,803 ---- * <p> * Note: changing modality of the visible dialog may have no effect * until it is hidden and then shown again. * * @param modal specifies whether dialog blocks input to other windows ! * when shown; calling to {@code setModal(true)} is equivalent to ! * {@code setModalityType(Dialog.DEFAULT_MODALITY_TYPE)}, and ! * calling to {@code setModal(false)} is equivalent to ! * {@code setModalityType(Dialog.ModalityType.MODELESS)} * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS * @see java.awt.Dialog#isModal * @see java.awt.Dialog#getModalityType
*** 825,846 **** /** * Sets the modality type for this dialog. See {@link * java.awt.Dialog.ModalityType ModalityType} for possible modality types. * <p> ! * If the given modality type is not supported, <code>MODELESS</code> ! * is used. You may want to call <code>getModalityType()</code> after calling * this method to ensure that the modality type has been set. * <p> * Note: changing modality of the visible dialog may have no effect * until it is hidden and then shown again. * * @param type specifies whether dialog blocks input to other ! * windows when shown. <code>null</code> value and unsupported modality ! * types are equivalent to <code>MODELESS</code> * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given <code>modalityType</code> * * @see java.awt.Dialog#getModalityType * @see java.awt.Toolkit#isModalityTypeSupported * * @since 1.6 --- 825,846 ---- /** * Sets the modality type for this dialog. See {@link * java.awt.Dialog.ModalityType ModalityType} for possible modality types. * <p> ! * If the given modality type is not supported, {@code MODELESS} ! * is used. You may want to call {@code getModalityType()} after calling * this method to ensure that the modality type has been set. * <p> * Note: changing modality of the visible dialog may have no effect * until it is hidden and then shown again. * * @param type specifies whether dialog blocks input to other ! * windows when shown. {@code null} value and unsupported modality ! * types are equivalent to {@code MODELESS} * @exception SecurityException if the calling thread does not have permission ! * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog#getModalityType * @see java.awt.Toolkit#isModalityTypeSupported * * @since 1.6
*** 864,874 **** /** * Gets the title of the dialog. The title is displayed in the * dialog's border. * @return the title of this dialog window. The title may be ! * <code>null</code>. * @see java.awt.Dialog#setTitle */ public String getTitle() { return title; } --- 864,874 ---- /** * Gets the title of the dialog. The title is displayed in the * dialog's border. * @return the title of this dialog window. The title may be ! * {@code null}. * @see java.awt.Dialog#setTitle */ public String getTitle() { return title; }
*** 1191,1212 **** } /** * Indicates whether this dialog is resizable by the user. * By default, all dialogs are initially resizable. ! * @return <code>true</code> if the user can resize the dialog; ! * <code>false</code> otherwise. * @see java.awt.Dialog#setResizable */ public boolean isResizable() { return resizable; } /** * Sets whether this dialog is resizable by the user. ! * @param resizable <code>true</code> if the user can ! * resize this dialog; <code>false</code> otherwise. * @see java.awt.Dialog#isResizable */ public void setResizable(boolean resizable) { boolean testvalid = false; --- 1191,1212 ---- } /** * Indicates whether this dialog is resizable by the user. * By default, all dialogs are initially resizable. ! * @return {@code true} if the user can resize the dialog; ! * {@code false} otherwise. * @see java.awt.Dialog#setResizable */ public boolean isResizable() { return resizable; } /** * Sets whether this dialog is resizable by the user. ! * @param resizable {@code true} if the user can ! * resize this dialog; {@code false} otherwise. * @see java.awt.Dialog#isResizable */ public void setResizable(boolean resizable) { boolean testvalid = false;
*** 1281,1292 **** } /** * Indicates whether this dialog is undecorated. * By default, all dialogs are initially decorated. ! * @return <code>true</code> if dialog is undecorated; ! * <code>false</code> otherwise. * @see java.awt.Dialog#setUndecorated * @since 1.4 */ public boolean isUndecorated() { return undecorated; --- 1281,1292 ---- } /** * Indicates whether this dialog is undecorated. * By default, all dialogs are initially decorated. ! * @return {@code true} if dialog is undecorated; ! * {@code false} otherwise. * @see java.awt.Dialog#setUndecorated * @since 1.4 */ public boolean isUndecorated() { return undecorated;
*** 1334,1344 **** /** * Returns a string representing the state of this dialog. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be ! * <code>null</code>. * * @return the parameter string of this dialog window. */ protected String paramString() { String str = super.paramString() + "," + modalityType; --- 1334,1344 ---- /** * Returns a string representing the state of this dialog. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be ! * {@code null}. * * @return the parameter string of this dialog window. */ protected String paramString() { String str = super.paramString() + "," + modalityType;
*** 1645,1655 **** return accessibleContext; } /** * This class implements accessibility support for the ! * <code>Dialog</code> class. It provides an implementation of the * Java Accessibility API appropriate to dialog user-interface elements. * @since 1.3 */ protected class AccessibleAWTDialog extends AccessibleAWTWindow { --- 1645,1655 ---- return accessibleContext; } /** * This class implements accessibility support for the ! * {@code Dialog} class. It provides an implementation of the * Java Accessibility API appropriate to dialog user-interface elements. * @since 1.3 */ protected class AccessibleAWTDialog extends AccessibleAWTWindow {
< prev index next >