java::awt::Dialog Class Reference

Inheritance diagram for java::awt::Dialog:

Inheritance graph
java::awt::Windowjava::awt::Containerjava::awt::Componentjava::lang::Objectjava::lang::Interfacejava::lang::Syncjava::awt::event::ComponentSourcejava::awt::event::FocusSourcejava::awt::event::HierarchySourcejava::awt::event::KeySourcejava::awt::event::MouseSourcejava::awt::event::PaintSourcejava::util::PropertyChangeSourcejava::awt::event::ContainerSourcejava::awt::event::WindowSourcejava::lang::Lockjava::lang::ScopeAdapterjava::awt::image::ImageObserverjava::util::EventSource
[legend]
Collaboration diagram for java::awt::Dialog:

Collaboration graph
java::awt::Windowjava::awt::Containerjava::awt::Componentjava::lang::Objectjava::lang::Interfacejava::lang::ObjectRefjava::lang::Syncjava::awt::event::ComponentSourcejava::awt::event::FocusSourcejava::awt::event::HierarchySourcejava::awt::event::KeySourcejava::awt::event::MouseSourcejava::awt::event::PaintSourcejava::util::PropertyChangeSourcejava::awt::event::ContainerSourcejava::awt::event::WindowSourcejava::lang::Lockjava::lang::ScopeAdapterjava::lang::Comparablejava::awt::image::ImageObserverjava::util::EventSourcejava::util::Collectionjava::util::LinkedListjava::util::AbstractSequentialListjava::util::AbstractListjava::util::AbstractCollectionjava::util::List
[legend]

List of all members.


Detailed Description

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 must have either a frame or another dialog defined 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 java.awt.Frame for more information.

A dialog can be either modeless (the default) or modal. A modal dialog is one which blocks input to all other toplevel windows in the application, except for any windows created with the dialog as their owner.

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

See also:
WindowEvent

Window::addWindowListener

Version:
1.90, 01/23/03
Author:
Sami Shaio

Arthur van Hoff

Since:
JDK1.0

Public Member Functions

 Dialog (const String &title=nilString, const Ref< Window > &owner=0, jboolean modal=false)
 Constructs an initially invisible Dialog with the specified owner frame, title, and modality.
virtual jboolean isModal () const
 Indicates whether the dialog is modal.
virtual void setModal (jboolean b)
 Specifies whether this dialog should be modal.
virtual String getTitle () const
 Gets the title of the dialog.
virtual void setTitle (const String &title)
 Sets the title of the Dialog.
virtual jboolean isResizable () const
 Indicates whether this dialog is resizable by the user.
virtual void setResizable (jboolean resizable)
 Sets whether this dialog is resizable by the user.
virtual jboolean isUndecorated () const
 Indicates whether this dialog is undecorated.
virtual void setUndecorated (jboolean undecorated)
 Disables or enables decorations for this dialog.
virtual String toString () const
 Returns a string representation of this component and its values.

Protected Attributes

 REGISTER_MEMBERS

Constructor & Destructor Documentation

java::awt::Dialog::Dialog ( const String title = nilString,
const Ref< Window > &  owner = 0,
jboolean  modal = false 
)

Constructs an initially invisible Dialog with the specified owner frame, title, and modality.

Parameters:
owner the owner of the dialog
title the title of the dialog; a null value will be accepted without causing a NullPointerException to be thrown
modal if true, dialog blocks input to other app windows when shown
Exceptions:
IllegalArgumentException if the owner's GraphicsConfiguration is not from a screen device
java.lang.IllegalArgumentException if owner is null. This exception is always thrown when GraphicsEnvironment.isHeadless returns true
See also:
java.awt.GraphicsEnvironment::isHeadless

Component::setSize

Component::setVisible


Member Function Documentation

virtual jboolean java::awt::Dialog::isModal (  )  const [virtual]

Indicates whether the dialog is modal.

When a modal Dialog is made visible, user input will be blocked to the other windows in the application, except for any windows created with this dialog as their owner.

Returns:
true if this dialog window is modal; false otherwise.
See also:
java.awt.Dialog::setModal

virtual void java::awt::Dialog::setModal ( jboolean  b  )  [virtual]

Specifies whether this dialog should be modal.

*

See also:
java.awt.Dialog::isModal
Since:
JDK1.1

virtual String java::awt::Dialog::getTitle (  )  const [virtual]

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:
java.awt.Dialog::setTitle

virtual void java::awt::Dialog::setTitle ( const String title  )  [virtual]

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

virtual jboolean java::awt::Dialog::isResizable (  )  const [virtual]

Indicates whether this dialog is resizable by the user.

Returns:
true if the user can resize the dialog; false otherwise.
See also:
java.awt.Dialog::setResizable

virtual void java::awt::Dialog::setResizable ( jboolean  resizable  )  [virtual]

Sets whether this dialog is resizable by the user.

Parameters:
resizable true if the user can resize this dialog; false otherwise.
See also:
java.awt.Dialog::isResizable

virtual jboolean java::awt::Dialog::isUndecorated (  )  const [virtual]

Indicates whether this dialog is undecorated.

By default, all dialogs are initially decorated.

Returns:
true if dialog is undecorated; false otherwise.
See also:
java.awt.Dialog::setUndecorated
Since:
1.4

virtual void java::awt::Dialog::setUndecorated ( jboolean  undecorated  )  [virtual]

Disables or enables decorations for this dialog.

This method can only be called while the dialog is not displayable.

Parameters:
undecorated true if no dialog decorations are to be enabled; false if dialog decorations are to be enabled.
Exceptions:
<code>IllegalComponentStateException</code> if the dialog is displayable.
See also:
isUndecorated

Component::isDisplayable

Since:
1.4

virtual String java::awt::Dialog::toString (  )  const [virtual]

Returns a string representation of this component and its values.

Returns:
a string representation of this component
Since:
JDK1.0

Reimplemented from java::awt::Window.


Member Data Documentation

java::awt::Dialog::REGISTER_MEMBERS [protected]

Reimplemented from java::awt::Window.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:55:58 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3