| JavaTM 2 Platform Std. Ed. v1.6.0
java.awt
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 class Dialog - extends Window
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 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 pack or 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 (insets.left, insets.top), and has a size of
width - (insets.left + insets.right) by
height - (insets.top + insets.bottom).
The default layout for a dialog is BorderLayout.
A dialog may have its native decorations (i.e. Frame & Titlebar) turned off
with setUndecorated. This can only be done while the dialog
is not displayable.
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 a Dialog
on a different screen device than its owner. See Frame 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. See AWT Modality
specification for details.
Dialogs are capable of generating the following
WindowEvents:
WindowOpened, WindowClosing,
WindowClosed, WindowActivated,
WindowDeactivated, WindowGainedFocus,
WindowLostFocus.
- Since:
- JDK1.0
- See Also:
WindowEvent,
Window.addWindowListener(java.awt.event.WindowListener),
Serialized Form
|
Constructor Summary |
Dialog(Dialog owner)
Constructs an initially invisible, modeless Dialog with
the specified owner Dialog and an empty title. |
Dialog(Dialog owner,
String title)
Constructs an initially invisible, modeless Dialog
with the specified owner Dialog and title. |
Dialog(Dialog owner,
String title,
boolean modal)
Constructs an initially invisible Dialog with the
specified owner Dialog, title, and modality. |
Dialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Constructs an initially invisible Dialog with the
specified owner Dialog, title, modality and
GraphicsConfiguration. |
Dialog(Frame owner)
Constructs an initially invisible, modeless Dialog with
the specified owner Frame and an empty title. |
Dialog(Frame owner,
boolean modal)
Constructs an initially invisible Dialog with the specified
owner Frame and modality and an empty title. |
Dialog(Frame owner,
String title)
Constructs an initially invisible, modeless Dialog with
the specified owner Frame and title. |
Dialog(Frame owner,
String title,
boolean modal)
Constructs an initially invisible Dialog with the
specified owner Frame, title and modality. |
Dialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Constructs an initially invisible Dialog with the specified owner
Frame, title, modality, and GraphicsConfiguration. |
Dialog(Window owner)
Constructs an initially invisible, modeless Dialog with the
specified owner Window and an empty title. |
Dialog(Window owner,
Dialog.ModalityType modalityType)
Constructs an initially invisible Dialog with the
specified owner Window and modality and an empty title. |
Dialog(Window owner,
String title)
Constructs an initially invisible, modeless Dialog with
the specified owner Window and title. |
Dialog(Window owner,
String title,
Dialog.ModalityType modalityType)
Constructs an initially invisible Dialog with the
specified owner Window, title and modality. |
Dialog(Window owner,
String title,
Dialog.ModalityType modalityType,
GraphicsConfiguration gc)
Constructs an initially invisible Dialog with the
specified owner Window, title, modality and
GraphicsConfiguration. |
|
Method Summary |
void |
addNotify()
Makes this Dialog displayable by connecting it to
a native screen resource. |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this Dialog. |
Dialog.ModalityType |
getModalityType()
Returns the modality type of this dialog. |
String |
getTitle()
Gets the title of the dialog. |
void |
hide()
Deprecated. As of JDK version 1.5, replaced by
setVisible(boolean). |
boolean |
isModal()
Indicates whether the dialog is modal. |
boolean |
isResizable()
Indicates whether this dialog is resizable by the user. |
boolean |
isUndecorated()
Indicates whether this dialog is undecorated. |
protected String |
paramString()
Returns a string representing the state of this dialog. |
void |
setModal(boolean modal)
Specifies whether this dialog should be modal. |
void |
setModalityType(Dialog.ModalityType type)
Sets the modality type for this dialog. |
void |
setResizable(boolean resizable)
Sets whether this dialog is resizable by the user. |
void |
setTitle(String title)
Sets the title of the Dialog. |
void |
setUndecorated(boolean undecorated)
Disables or enables decorations for this dialog. |
void |
setVisible(boolean b)
Shows or hides this Dialog depending on the value of parameter
b. |
void |
show()
Deprecated. As of JDK version 1.5, replaced by
setVisible(boolean). |
void |
toBack()
If this Window is visible, sends this Window to the back and may cause
it to lose focus or activation if it is the focused or active Window. |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
DEFAULT_MODALITY_TYPE
public static final Dialog.ModalityType DEFAULT_MODALITY_TYPE
- Default modality type for modal dialogs. The default modality type is
APPLICATION_MODAL. Calling the oldstyle setModal(true)
is equal to setModalityType(DEFAULT_MODALITY_TYPE).
- Since:
- 1.6
- See Also:
Dialog.ModalityType,
setModal(boolean)
Dialog
public Dialog(Frame owner)
- Constructs an initially invisible, modeless
Dialog with
the specified owner Frame and an empty title.
- Parameters:
owner - the owner of the dialog or null if
this dialog has no owner
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- See Also:
GraphicsEnvironment.isHeadless(),
Component.setSize(int, int),
Component.setVisible(boolean)
Dialog
public Dialog(Frame owner,
boolean modal)
- Constructs an initially invisible
Dialog with the specified
owner Frame and modality and an empty title.
- Parameters:
owner - the owner of the dialog or null if
this dialog has no ownermodal - specifes whether dialog blocks user input to other top-level
windows when shown. If false, the dialog is MODELESS;
if true, the modality type property is set to
DEFAULT_MODALITY_TYPE
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- See Also:
Dialog.ModalityType,
Dialog.ModalityType.MODELESS,
DEFAULT_MODALITY_TYPE,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless()
Dialog
public Dialog(Frame owner,
String title)
- Constructs an initially invisible, modeless
Dialog with
the specified owner Frame and title.
- Parameters:
owner - the owner of the dialog or null if
this dialog has no ownertitle - the title of the dialog or null if this dialog
has no title
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- See Also:
GraphicsEnvironment.isHeadless(),
Component.setSize(int, int),
Component.setVisible(boolean)
Dialog
public Dialog(Frame owner,
String title,
boolean modal)
- Constructs an initially invisible
Dialog with the
specified owner Frame, title and modality.
- Parameters:
owner - the owner of the dialog or null if
this dialog has no ownertitle - the title of the dialog or null if this dialog
has no titlemodal - specifes whether dialog blocks user input to other top-level
windows when shown. If false, the dialog is MODELESS;
if true, the modality type property is set to
DEFAULT_MODALITY_TYPE
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- See Also:
Dialog.ModalityType,
Dialog.ModalityType.MODELESS,
DEFAULT_MODALITY_TYPE,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless(),
Component.setSize(int, int),
Component.setVisible(boolean)
Dialog
public Dialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
- Constructs an initially invisible
Dialog with the specified owner
Frame, title, modality, and GraphicsConfiguration.
- Parameters:
owner - the owner of the dialog or null if this dialog
has no ownertitle - the title of the dialog or null if this dialog
has no titlemodal - specifes whether dialog blocks user input to other top-level
windows when shown. If false, the dialog is MODELESS;
if true, the modality type property is set to
DEFAULT_MODALITY_TYPEgc - the GraphicsConfiguration of the target screen device;
if null, the default system GraphicsConfiguration
is assumed
- Throws:
IllegalArgumentException - if gc
is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.4
- See Also:
Dialog.ModalityType,
Dialog.ModalityType.MODELESS,
DEFAULT_MODALITY_TYPE,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless(),
Component.setSize(int, int),
Component.setVisible(boolean)
Dialog
public Dialog(Dialog owner)
- Constructs an initially invisible, modeless
Dialog with
the specified owner Dialog and an empty title.
- Parameters:
owner - the owner of the dialog or null if this
dialog has no owner
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.2
- See Also:
GraphicsEnvironment.isHeadless()
Dialog
public Dialog(Dialog owner,
String title)
- Constructs an initially invisible, modeless
Dialog
with the specified owner Dialog and title.
- Parameters:
owner - the owner of the dialog or null if this
has no ownertitle - the title of the dialog or null if this dialog
has no title
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.2
- See Also:
GraphicsEnvironment.isHeadless()
Dialog
public Dialog(Dialog owner,
String title,
boolean modal)
- Constructs an initially invisible
Dialog with the
specified owner Dialog, title, and modality.
- Parameters:
owner - the owner of the dialog or null if this
dialog has no ownertitle - the title of the dialog or null if this
dialog has no titlemodal - specifes whether dialog blocks user input to other top-level
windows when shown. If false, the dialog is MODELESS;
if true, the modality type property is set to
DEFAULT_MODALITY_TYPE
- Throws:
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.2
- See Also:
Dialog.ModalityType,
Dialog.ModalityType.MODELESS,
DEFAULT_MODALITY_TYPE,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless()
Dialog
public Dialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc)
- Constructs an initially invisible
Dialog with the
specified owner Dialog, title, modality and
GraphicsConfiguration.
- Parameters:
owner - the owner of the dialog or null if this
dialog has no ownertitle - the title of the dialog or null if this
dialog has no titlemodal - specifes whether dialog blocks user input to other top-level
windows when shown. If false, the dialog is MODELESS;
if true, the modality type property is set to
DEFAULT_MODALITY_TYPEgc - the GraphicsConfiguration of the target screen device;
if null, the default system GraphicsConfiguration
is assumed
- Throws:
IllegalArgumentException - if gc
is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.4
- See Also:
Dialog.ModalityType,
Dialog.ModalityType.MODELESS,
DEFAULT_MODALITY_TYPE,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless(),
Component.setSize(int, int),
Component.setVisible(boolean)
Dialog
public Dialog(Window owner)
- Constructs an initially invisible, modeless
Dialog with the
specified owner Window and an empty title.
- Parameters:
owner - the owner of the dialog. The owner must be an instance of
Dialog, Frame, any
of their descendents or null
- Throws:
IllegalArgumentException - if the owner
is not an instance of Dialog or Frame
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.6
- See Also:
GraphicsEnvironment.isHeadless()
Dialog
public Dialog(Window owner,
String title)
- Constructs an initially invisible, modeless
Dialog with
the specified owner Window and title.
- Parameters:
owner - the owner of the dialog. The owner must be an instance of
Dialog, Frame, any
of their descendents or nulltitle - the title of the dialog or null if this dialog
has no title
- Throws:
IllegalArgumentException - if the owner
is not an instance of Dialog or Frame
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true- Since:
- 1.6
- See Also:
GraphicsEnvironment.isHeadless()
Dialog
public Dialog(Window owner,
Dialog.ModalityType modalityType)
- Constructs an initially invisible
Dialog with the
specified owner Window and modality and an empty title.
- Parameters:
owner - the owner of the dialog. The owner must be an instance of
Dialog, Frame, any
of their descendents or nullmodalityType - specifies whether dialog blocks input to other
windows when shown. null value and unsupported modality
types are equivalent to MODELESS
- Throws:
IllegalArgumentException - if the owner
is not an instance of Dialog or Frame
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true
SecurityException - if the calling thread does not have permission
to create modal dialogs with the given modalityType- Since:
- 1.6
- See Also:
Dialog.ModalityType,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless(),
Toolkit.isModalityTypeSupported(java.awt.Dialog.ModalityType)
Dialog
public Dialog(Window owner,
String title,
Dialog.ModalityType modalityType)
- Constructs an initially invisible
Dialog with the
specified owner Window, title and modality.
- Parameters:
owner - the owner of the dialog. The owner must be an instance of
Dialog, Frame, any
of their descendents or nulltitle - the title of the dialog or null if this dialog
has no titlemodalityType - specifies whether dialog blocks input to other
windows when shown. null value and unsupported modality
types are equivalent to MODELESS
- Throws:
IllegalArgumentException - if the owner
is not an instance of Dialog or Frame
IllegalArgumentException - if the owner's
GraphicsConfiguration is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true
SecurityException - if the calling thread does not have permission
to create modal dialogs with the given modalityType- Since:
- 1.6
- See Also:
Dialog.ModalityType,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless(),
Toolkit.isModalityTypeSupported(java.awt.Dialog.ModalityType)
Dialog
public Dialog(Window owner,
String title,
Dialog.ModalityType modalityType,
GraphicsConfiguration gc)
- Constructs an initially invisible
Dialog with the
specified owner Window, title, modality and
GraphicsConfiguration.
- Parameters:
owner - the owner of the dialog. The owner must be an instance of
Dialog, Frame, any
of their descendents or nulltitle - the title of the dialog or null if this dialog
has no titlemodalityType - specifies whether dialog blocks input to other
windows when shown. null value and unsupported modality
types are equivalent to MODELESSgc - the GraphicsConfiguration of the target screen device;
if null, the default system GraphicsConfiguration
is assumed
- Throws:
IllegalArgumentException - if the owner
is not an instance of Dialog or Frame
IllegalArgumentException - if gc
is not from a screen device
HeadlessException - when
GraphicsEnvironment.isHeadless() returns true
SecurityException - if the calling thread does not have permission
to create modal dialogs with the given modalityType- Since:
- 1.6
- See Also:
Dialog.ModalityType,
setModal(boolean),
setModalityType(java.awt.Dialog.ModalityType),
GraphicsEnvironment.isHeadless(),
Toolkit.isModalityTypeSupported(java.awt.Dialog.ModalityType)
addNotify
public void addNotify()
- Makes this Dialog displayable by connecting it to
a native screen resource. Making a dialog displayable will
cause any of its children to be made displayable.
This method is called internally by the toolkit and should
not be called directly by programs.
- Overrides:
addNotify in class Window
- See Also:
Component.isDisplayable(),
Window.removeNotify()
isModal
public boolean isModal()
- Indicates whether the dialog is modal.
This method is obsolete and is kept for backwards compatiblity only.
Use getModalityType() instead.
- Returns:
true if this dialog window is modal;
false otherwise- See Also:
DEFAULT_MODALITY_TYPE,
Dialog.ModalityType.MODELESS,
setModal(boolean),
getModalityType(),
setModalityType(java.awt.Dialog.ModalityType)
setModal
public void setModal(boolean modal)
- Specifies whether this dialog should be modal.
This method is obsolete and is kept for backwards compatibility only.
Use setModalityType() instead.
Note: changing modality of the visible dialog may have no effect
until it is hidden and then shown again.
- Parameters:
modal - specifies whether dialog blocks input to other windows
when shown; calling to setModal(true) is equivalent to
setModalityType(Dialog.DEFAULT_MODALITY_TYPE), and
calling to setModal(false) is equvivalent to
setModalityType(Dialog.ModalityType.MODELESS)- Since:
- 1.1
- See Also:
DEFAULT_MODALITY_TYPE,
Dialog.ModalityType.MODELESS,
isModal(),
getModalityType(),
setModalityType(java.awt.Dialog.ModalityType)
getModalityType
public Dialog.ModalityType getModalityType()
- Returns the modality type of this dialog.
- Returns:
- modality type of this dialog
- Since:
- 1.6
- See Also:
setModalityType(java.awt.Dialog.ModalityType)
setModalityType
public void setModalityType(Dialog.ModalityType type)
- Sets the modality type for this dialog. See
ModalityType for possible modality types.
If the given modality type is not supported, MODELESS
is used. You may want to call getModalityType() after calling
this method to ensure that the modality type has been set.
Note: changing modality of the visible dialog may have no effect
until it is hidden and then shown again.
- Parameters:
type - specifies whether dialog blocks input to other
windows when shown. null value and unsupported modality
types are equivalent to MODELESS
- Throws:
SecurityException - if the calling thread does not have permission
to create modal dialogs with the given modalityType- Since:
- 1.6
- See Also:
getModalityType(),
Toolkit.isModalityTypeSupported(java.awt.Dialog.ModalityType)
getTitle
public String getTitle()
- Gets the title of the dialog. The title is displayed in the
dialog's border.
- Returns:
- the title of this dialog window. The title may be
null. - See Also:
setTitle(java.lang.String)
setTitle
public void setTitle(String title)
- Sets the title of the Dialog.
- Parameters:
title - the title displayed in the dialog's border;
a null value results in an empty title- See Also:
getTitle()
setVisible
public void setVisible(boolean b)
- Shows or hides this
Dialog depending on the value of parameter
b.
- Overrides:
setVisible in class Window
- Parameters:
b - if true, makes the Dialog visible,
otherwise hides the Dialog.
If the dialog and/or its owner
are not yet displayable, both are made displayable. The
dialog will be validated prior to being made visible.
If false, hides the Dialog and then causes setVisible(true)
to return if it is currently blocked.
Notes for modal dialogs.
setVisible(true): If the dialog is not already
visible, this call will not return until the dialog is
hidden by calling setVisible(false) or
dispose.
setVisible(false): Hides the dialog and then
returns on setVisible(true) if it is currently blocked.
- It is OK to call this method from the event dispatching
thread because the toolkit ensures that other events are
not blocked while this method is blocked.
- See Also:
Window.setVisible(boolean),
Window.dispose(),
Component.isDisplayable(),
Component.validate(),
isModal()
show
@Deprecated
public void show()
- Deprecated. As of JDK version 1.5, replaced by
setVisible(boolean).
- Makes the
Dialog visible. If the dialog and/or its owner
are not |