Serializable
, Comparable<Dialog.ModalityType>
, Constable
Dialog
public static enum Dialog.ModalityType extends Enum<Dialog.ModalityType>
ModalityType
enum specifies modal types and their associated scopes.Enum.EnumDesc<E extends Enum<E>>
Enum Constant | Description |
---|---|
APPLICATION_MODAL |
An APPLICATION_MODAL dialog blocks all top-level windows from the same Java application except those from its own child hierarchy. |
DOCUMENT_MODAL |
A DOCUMENT_MODAL dialog blocks input to all top-level windows from the same document except those from its own child hierarchy. |
MODELESS |
MODELESS dialog doesn't block any top-level windows. |
TOOLKIT_MODAL |
A TOOLKIT_MODAL dialog blocks all top-level windows run from the same toolkit except those from its own child hierarchy. |
Modifier and Type | Method | Description |
---|---|---|
static Dialog.ModalityType |
valueOf |
Returns the enum constant of this class with the specified name. |
static Dialog.ModalityType[] |
values() |
Returns an array containing the constants of this enum class, in the order they are declared. |
public static final Dialog.ModalityType MODELESS
MODELESS
dialog doesn't block any top-level windows.public static final Dialog.ModalityType DOCUMENT_MODAL
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.public static final Dialog.ModalityType APPLICATION_MODAL
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.public static final Dialog.ModalityType TOOLKIT_MODAL
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 AWTPermission
"toolkitModality" must be granted to use toolkit-modal dialogs. If a TOOLKIT_MODAL
dialog is being created and this permission is not granted, a SecurityException
will be thrown, and no dialog will be created. If a modality type is being changed to TOOLKIT_MODAL
and this permission is not granted, a SecurityException
will be thrown, and the modality type will be left unchanged.public static Dialog.ModalityType[] values()
public static Dialog.ModalityType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/Dialog.ModalityType.html