Class Dialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
Direct Known Subclasses:
FileDialog,JDialog

public classDialogextendsWindow
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 thegetInsets method, however, since these dimensions are platform-dependent, a valid insets value cannot be obtained until the dialog is made displayable by either callingpack orshow. 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(insets.left, insets.top), and has a size ofwidth - (insets.left + insets.right) byheight - (insets.top + insets.bottom).

The default layout for a dialog isBorderLayout.

A dialog may have its native decorations (i.e. Frame & Titlebar) turned off withsetUndecorated. This can only be done while the dialog is notdisplayable.

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.

In a multi-screen environment, you can create aDialog on a different screen device than its owner. SeeFrame for more information.

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. SeeAWT Modality specification for details.

Dialogs are capable of generating the followingWindowEvents:WindowOpened,WindowClosing,WindowClosed,WindowActivated,WindowDeactivated,WindowGainedFocus,WindowLostFocus.

Since:
1.0
See Also: