Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.awt
Class Dialog  view Dialog download Dialog.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, MenuContainer, java.io.Serializable
Direct Known Subclasses:
FileDialog

public class Dialog
extends Window

Dialog provides a top-level window normally used to receive user input in applications.

A dialog always has another top-level window as owner and is only visible if this owner is visible to the user. The default layout of dialogs is the BorderLayout. Dialogs can be modal (blocks user input to other components) or non-modal (user input in other components are allowed).


Nested Class Summary
protected  class Dialog.AccessibleAWTDialog
          Accessibility support for Dialog.
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer, Container.GfxPaintAllVisitor, Container.GfxPaintVisitor, Container.GfxPrintAllVisitor, Container.GfxPrintVisitor, Container.GfxVisitor
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy, Component.HeavyweightInLightweightListener
 
Field Summary
private  boolean blocked
          Indicates that we are blocked for modality in show
private  EventQueue eq2
          Secondary EventQueue to handle AWT events while we are blocked for modality in show.
private  boolean modal
           
private  boolean resizable
           
private static long serialVersionUID
           
private  java.lang.String title
           
private  boolean undecorated
          This field indicates whether the dialog is undecorated or not.
 
Fields inherited from class java.awt.Window
windowFocusOwner
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, focusCycleRoot, focusTraversalKeys, layoutMgr, maxSize, ncomponents
 
Fields inherited from class java.awt.Component
accessibleContext, background, BOTTOM_ALIGNMENT, bufferStrategy, CENTER_ALIGNMENT, changeSupport, componentListener, componentSerializedDataVersion, cursor, dropTarget, enabled, eventMask, focusable, focusListener, focusTraversalKeysEnabled, font, foreground, graphicsConfig, height, hierarchyBoundsListener, hierarchyListener, ignoreRepaint, inputMethodListener, isFocusTraversableOverridden, isPacked, keyListener, LEFT_ALIGNMENT, locale, minSize, mouseListener, mouseMotionListener, mouseWheelListener, name, nameExplicitlySet, newEventsOnly, orientation, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, TOP_ALIGNMENT, treeLock, valid, visible, width, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Dialog(Dialog owner)
          Initializes a new instance of Dialog with the specified, parent, that is resizable.
Dialog(Dialog owner, java.lang.String title)
          Initializes a new instance of Dialog with the specified, parent and title, that is resizable.
Dialog(Dialog owner, java.lang.String title, boolean modal)
          Initializes a new instance of Dialog with the specified, parent, title and modality, that is resizable.
Dialog(Dialog parent, java.lang.String title, boolean modal, GraphicsConfiguration gc)
          Initializes a new instance of Dialog with the specified, parent, title, modality and GraphicsConfiguration, that is resizable.
Dialog(Frame parent)
          Initializes a new instance of Dialog with the specified parent, that is resizable and not modal, and which has no title.
Dialog(Frame parent, boolean modal)
          Initializes a new instance of Dialog with the specified parent and modality, that is resizable and which has no title.
Dialog(Frame parent, java.lang.String title)
          Initializes a new instance of Dialog with the specified parent, that is resizable and not modal, and which has the specified title.
Dialog(Frame parent, java.lang.String title, boolean modal)
          Initializes a new instance of Dialog with the specified, parent, title, and modality, that is resizable.
Dialog(Frame parent, java.lang.String title, boolean modal, GraphicsConfiguration gc)
          Initializes a new instance of Dialog with the specified, parent, title, modality and GraphicsConfiguration, that is resizable.
 
Method Summary
 void addNotify()
          Creates this object's native peer.
 void dispose()
          Disposes the Dialog and then causes show() to return if it is currently blocked.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this Dialog.
 java.lang.String getTitle()
          Returns the title of this dialog box.
 void hide()
          Deprecated. Use Component.setVisible(boolean) 55 instead.
 boolean isModal()
          Tests whether or not this dialog box is modal.
 boolean isResizable()
          Tests whether or not this dialog box is resizable.
 boolean isUndecorated()
          Returns whether this frame is undecorated or not.
protected  java.lang.String paramString()
          Returns a debugging string for this component.
 void setModal(boolean modal)
          Changes the modality of this dialog box.
 void setResizable(boolean resizable)
          Changes the resizability of this dialog box.
 void setTitle(java.lang.String title)
          Sets the title of this dialog box to the specified string.
 void setUndecorated(boolean undecorated)
          Disables or enables decorations for this frame.
 void show()
          Deprecated. Use Component.setVisible(boolean) 55 instead.
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispatchEventImpl, generateName, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getGraphicsConfigurationImpl, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setFocusOwner, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, eventTypeEnabled, findComponentAt, findComponentAt, findNextFocusComponent, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, invalidateTree, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setPeer, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, translateEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

modal

private boolean modal

resizable

private boolean resizable

title

private java.lang.String title

undecorated

private boolean undecorated
This field indicates whether the dialog is undecorated or not.


blocked

private boolean blocked
Indicates that we are blocked for modality in show


eq2

private EventQueue eq2
Secondary EventQueue to handle AWT events while we are blocked for modality in show.

Constructor Detail

Dialog

public Dialog(Frame parent)
Initializes a new instance of Dialog with the specified parent, that is resizable and not modal, and which has no title.


Dialog

public Dialog(Frame parent,
              boolean modal)
Initializes a new instance of Dialog with the specified parent and modality, that is resizable and which has no title.


Dialog

public Dialog(Frame parent,
              java.lang.String title)
Initializes a new instance of Dialog with the specified parent, that is resizable and not modal, and which has the specified title.


Dialog

public Dialog(Frame parent,
              java.lang.String title,
              boolean modal)
Initializes a new instance of Dialog with the specified, parent, title, and modality, that is resizable.


Dialog

public Dialog(Frame parent,
              java.lang.String title,
              boolean modal,
              GraphicsConfiguration gc)
Initializes a new instance of Dialog with the specified, parent, title, modality and GraphicsConfiguration, that is resizable.

Since:
1.4

Dialog

public Dialog(Dialog owner)
Initializes a new instance of Dialog with the specified, parent, that is resizable.

Since:
1.2

Dialog

public Dialog(Dialog owner,
              java.lang.String title)
Initializes a new instance of Dialog with the specified, parent and title, that is resizable.

Since:
1.2

Dialog

public Dialog(Dialog owner,
              java.lang.String title,
              boolean modal)
Initializes a new instance of Dialog with the specified, parent, title and modality, that is resizable.

Since:
1.2

Dialog

public Dialog(Dialog parent,
              java.lang.String title,
              boolean modal,
              GraphicsConfiguration gc)
Initializes a new instance of Dialog with the specified, parent, title, modality and GraphicsConfiguration, that is resizable.

Since:
1.4
Method Detail

getTitle

public java.lang.String getTitle()
Returns the title of this dialog box.


setTitle

public void setTitle(java.lang.String title)
Sets the title of this dialog box to the specified string.


isModal

public boolean isModal()
Tests whether or not this dialog box is modal.


setModal

public void setModal(boolean modal)
Changes the modality of this dialog box. This can only be done before the peer is created.


isResizable

public boolean isResizable()
Tests whether or not this dialog box is resizable.


setResizable

public void setResizable(boolean resizable)
Changes the resizability of this dialog box.


addNotify

public void addNotify()
Creates this object's native peer.

Overrides:
addNotify in class Window

show

public void show()
Deprecated. Use Component.setVisible(boolean) 55 instead.

Makes this dialog visible and brings it to the front. If the dialog is modal and is not already visible, this call will not return until the dialog is hidden by someone calling hide or dispose. If this is the event dispatching thread we must ensure that another event thread runs while the one which invoked this method is blocked.

Overrides:
show in class Window

hide

public void hide()
Deprecated. Use Component.setVisible(boolean) 55 instead.

Hides the Dialog and then causes show() to return if it is currently blocked.

Overrides:
hide in class Window

dispose

public void dispose()
Disposes the Dialog and then causes show() to return if it is currently blocked.

Overrides:
dispose in class Window

paramString

protected java.lang.String paramString()
Returns a debugging string for this component.

Overrides:
paramString in class Container

isUndecorated

public boolean isUndecorated()
Returns whether this frame is undecorated or not.

Since:
1.4

setUndecorated

public void setUndecorated(boolean undecorated)
Disables or enables decorations for this frame. This method can only be called while the frame is not displayable.

Since:
1.4

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this Dialog. The context is created, if necessary.

Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class Window