All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Window

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window

public class Window
extends Container
A Window is a top-level window with no borders and no menubar. It could be used to implement a pop-up menu. The default layout for a window is BorderLayout. Windows are capable of generating the following window events: WindowOpened, WindowClosed.

See Also:
WindowEvent, addWindowListener

Constructor Index

 o Window(Frame)
Constructs a new Window initialized to an invisible state.

Method Index

 o addNotify()
Creates the Window's peer.
 o addWindowListener(WindowListener)
Adds the specified window listener to receive window events from this window.
 o dispose()
Disposes of the Window.
 o getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active.
 o getLocale()
Gets the Locale for the window, if it has been set.
 o getToolkit()
Returns the toolkit of this frame.
 o getWarningString()
Gets the warning string for this window.
 o isShowing()
Checks if this Window is showing on screen.
 o pack()
Packs the components of the Window.
 o postEvent(Event)
Deprecated.
 o processEvent(AWTEvent)
Processes events on this window.
 o processWindowEvent(WindowEvent)
Processes window events occurring on this window by dispatching them to any registered WindowListener objects.
 o removeWindowListener(WindowListener)
Removes the specified window listener so that it no longer receives window events from this window.
 o show()
Shows the Window.
 o toBack()
Places this window at the bottom of the stacking order and makes the corresponding adjustment to other visible windows.
 o toFront()
Places this window at the top of the stacking order and shows it in front of any other windows.

Constructors

 o Window
    method Window(parent=Frame) public 
Constructs a new Window initialized to an invisible state. It behaves as a modal dialog in that it will block input to other windows when shown.

Parameters:
parent - the owner of the dialog
See Also:
setSize, show

Methods

 o addNotify
    method addNotify()  public     
Creates the Window's peer. The peer allows us to modify the appearance of the Window without changing its functionality.

Overrides:
addNotify in class Container
 o pack
    method pack()  public     
Packs the components of the Window.

 o show
    method show()  public     
Shows the Window. This will bring the window to the front if the window is already visible.

Overrides:
show in class Component
See Also:
hide
 o dispose
    method dispose()  public     
Disposes of the Window. This method must be called to release the resources that are used for the window.

 o toFront
    method toFront()  public     
Places this window at the top of the stacking order and shows it in front of any other windows.

 o toBack
    method toBack()  public     
Places this window at the bottom of the stacking order and makes the corresponding adjustment to other visible windows.

 o getToolkit
    method getToolkit() returns Toolkit public     
Returns the toolkit of this frame.

Overrides:
getToolkit in class Component
See Also:
Toolkit
 o getWarningString
    method getWarningString() returns String public   final  
Gets the warning string for this window. This is a string that will be displayed somewhere in the visible area of windows that are not secure.

 o getLocale
    method getLocale() returns Locale public     
Gets the Locale for the window, if it has been set. If no Locale has been set, then the default Locale is returned.

Overrides:
getLocale in class Component
 o addWindowListener
    method addWindowListener(l=WindowListener)  public    protect 
Adds the specified window listener to receive window events from this window.

Parameters:
l - the window listener
 o removeWindowListener
    method removeWindowListener(l=WindowListener)  public    protect 
Removes the specified window listener so that it no longer receives window events from this window.

Parameters:
l - the window listener
 o processEvent
    method processEvent(e=AWTEvent)  Inheritable     
Processes events on this window. If the event is an WindowEvent, it invokes the processWindowEvent method, else it invokes its superclass's processEvent.

Parameters:
e - the event
Overrides:
processEvent in class Container
 o processWindowEvent
    method processWindowEvent(e=WindowEvent)  Inheritable     
Processes window events occurring on this window by dispatching them to any registered WindowListener objects. NOTE: This method will not be called unless window events are enabled for this component; this happens when one of the following occurs: a) A WindowListener object is registered via addWindowListener() b) Window events are enabled via enableEvents()

Parameters:
e - the window event
See Also:
enableEvents
 o getFocusOwner
    method getFocusOwner() returns Component public     
Returns the child component of this Window which has focus if and only if this Window is active.

Returns:
the component with focus, or null if no children have focus assigned to them.
 o postEvent
    method postEvent(e=Event) returns boolean public     
Note: postEvent() is deprecated. As of JDK version 1.1 replaced by dispatchEvent(AWTEvent).

Overrides:
postEvent in class Component
 o isShowing
    method isShowing() returns boolean public     
Checks if this Window is showing on screen.

Overrides:
isShowing in class Component
See Also:
setVisible

All Packages  Class Hierarchy  This Package  Previous  Next  Index