Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt

Class Window

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


public class Window

extends Container

This class represents a top-level window with no decorations.

Authors:

Constructor Summary

Window(java.awt.Frame owner)

Initializes a new instance of Window with the specified parent.
Window(java.awt.Window owner)

Initializes a new instance of Window with the specified parent.
Window(java.awt.Window owner, java.awt.GraphicsConfiguration gc)

Initializes a new instance of Window with the specified parent.

Method Summary

voidaddNotify()

Creates the native peer for this window.
voidaddWindowFocusListener(java.awt.event.WindowFocusListener wfl)

Adds the specified listener to this window.
synchronized voidaddWindowListener(java.awt.event.WindowListener listener)

Adds the specified listener to the list of WindowListeners that will receive events for this window.
voidaddWindowStateListener(java.awt.event.WindowStateListener wsl)

Adds the specified listener to this window.
voidapplyResourceBundle(java.util.ResourceBundle rb)

voidapplyResourceBundle(java.lang.String rbName)

voiddispose()

Called to free any resource associated with this window.
voidfinalize()

Disposes of the input methods and context, and removes the WeakReference which formerly pointed to this Window from the parent's owned Window list.
java.awt.ComponentgetFocusOwner()

Returns the child window that has focus if this window is active.
java.awt.GraphicsConfigurationgetGraphicsConfiguration()

Get graphics configuration.
java.util.EventListener[]getListeners(java.lang.Class listenerType)

Returns an array of all the objects currently registered as FooListeners upon this Window.
java.util.LocalegetLocale()

Returns the locale that this window is configured for.
java.awt.Window[]getOwnedWindows()

java.awt.WindowgetOwner()

java.awt.ToolkitgetToolkit()

Returns the toolkit used to create this window.
java.lang.StringgetWarningString()

Returns the warning string that will be displayed if this window is popped up by an unsecure applet or application.
synchronized java.awt.event.WindowFocusListener[]getWindowFocusListeners()

Returns an array of all the window focus listeners registered on this window.
synchronized java.awt.event.WindowListener[]getWindowListeners()

Returns an array of all the window listeners registered on this window.
synchronized java.awt.event.WindowStateListener[]getWindowStateListeners()

Returns an array of all the window state listeners registered on this window.
voidhide()

booleanisDisplayable()

booleanisShowing()

Tests whether or not this window is visible on the screen.
voidpack()

Relays out this window's child components at their preferred size.
booleanpostEvent(java.awt.Event e)

Post a Java 1.0 event to the event queue.
voidprocessEvent(java.awt.AWTEvent evt)

Processes the specified event for this window.
voidprocessWindowEvent(java.awt.event.WindowEvent evt)

Dispatches this event to any listeners that are listening for WindowEvents on this window.
voidremoveWindowFocusListener(java.awt.event.WindowFocusListener wfl)

Removes the specified listener from this window.
synchronized voidremoveWindowListener(java.awt.event.WindowListener listener)

Removes the specified listener from the list of WindowListeners that will receive events for this window.
voidremoveWindowStateListener(java.awt.event.WindowStateListener wsl)

Removes the specified listener from this window.
voidsetCursor(java.awt.Cursor cursor)

Sets the cursor for this window to the specifiec cursor.
voidshow()

Makes this window visible and brings it to the front.
voidtoBack()

Sends this window to the back so that all other windows display in front of it.
voidtoFront()

Brings this window to the front so that it displays in front of any other windows.

Constructor Details

Window

public Window(java.awt.Frame owner)

Initializes a new instance of Window with the specified parent. The window will initially be invisible.

Parameters:

Throws:


Window

public Window(java.awt.Window owner)

Initializes a new instance of Window with the specified parent. The window will initially be invisible.

Since:Parameters:

Throws:


Window

public Window(java.awt.Window owner, java.awt.GraphicsConfiguration gc)

Initializes a new instance of Window with the specified parent. The window will initially be invisible.

Since:Parameters:

Throws:


Method Details

addNotify

public void addNotify()

Creates the native peer for this window.


addWindowFocusListener

public void addWindowFocusListener(java.awt.event.WindowFocusListener wfl)

Adds the specified listener to this window.

Parameters:


addWindowListener

public synchronized void addWindowListener(java.awt.event.WindowListener listener)

Adds the specified listener to the list of WindowListeners that will receive events for this window.

Parameters:


addWindowStateListener

public void addWindowStateListener(java.awt.event.WindowStateListener wsl)

Adds the specified listener to this window.

Since:Parameters:


applyResourceBundle

public void applyResourceBundle(java.lang.String rbName)

Since:Parameters:


applyResourceBundle

public void applyResourceBundle(java.util.ResourceBundle rb)

Since:Parameters:


dispose

public void dispose()

Called to free any resource associated with this window.


finalize

protected void finalize()

Disposes of the input methods and context, and removes the WeakReference which formerly pointed to this Window from the parent's owned Window list.

Throws:


getFocusOwner

public Component getFocusOwner()

Returns the child window that has focus if this window is active. This method returns null if this window is not active or no children have focus.

Returns:


getGraphicsConfiguration

public GraphicsConfiguration getGraphicsConfiguration()

Get graphics configuration. The implementation for Window will not ask any parent containers, since Window is a toplevel window and not actually embedded in the parent component.


getListeners

public EventListener[] getListeners(java.lang.Class listenerType)

Returns an array of all the objects currently registered as FooListeners upon this Window. FooListeners are registered using the addFooListener method.

Since:Parameters:

Throws:


getLocale

public Locale getLocale()

Returns the locale that this window is configured for.

Returns:


getOwnedWindows

public Window[] getOwnedWindows()

Since:

getOwner

public Window getOwner()


getToolkit

public Toolkit getToolkit()

Returns the toolkit used to create this window.

Returns:


getWarningString

public final String getWarningString()

Returns the warning string that will be displayed if this window is popped up by an unsecure applet or application.

Returns:


getWindowFocusListeners

public synchronized WindowFocusListener[] getWindowFocusListeners()

Returns an array of all the window focus listeners registered on this window.

Since:

getWindowListeners

public synchronized WindowListener[] getWindowListeners()

Returns an array of all the window listeners registered on this window.

Since:

getWindowStateListeners

public synchronized WindowStateListener[] getWindowStateListeners()

Returns an array of all the window state listeners registered on this window.

Since:

hide

public void hide()


isDisplayable

public boolean isDisplayable()


isShowing

public boolean isShowing()

Tests whether or not this window is visible on the screen.

Returns:


pack

public void pack()

Relays out this window's child components at their preferred size.


postEvent

public boolean postEvent(java.awt.Event e)

Post a Java 1.0 event to the event queue.

Parameters:


processEvent

protected void processEvent(java.awt.AWTEvent evt)

Processes the specified event for this window. If the event is an instance of WindowEvent, then processWindowEvent() is called to process the event, otherwise the superclass version of this method is invoked.

Parameters:


processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent evt)

Dispatches this event to any listeners that are listening for WindowEvents on this window. This method only gets invoked if it is enabled via enableEvents() or if a listener has been added.

Parameters:


removeWindowFocusListener

public void removeWindowFocusListener(java.awt.event.WindowFocusListener wfl)

Removes the specified listener from this window.

Parameters:


removeWindowListener

public synchronized void removeWindowListener(java.awt.event.WindowListener listener)

Removes the specified listener from the list of WindowListeners that will receive events for this window.

Parameters:


removeWindowStateListener

public void removeWindowStateListener(java.awt.event.WindowStateListener wsl)

Removes the specified listener from this window.

Since:Parameters:


setCursor

public void setCursor(java.awt.Cursor cursor)

Sets the cursor for this window to the specifiec cursor.

Parameters:


show

public void show()

Makes this window visible and brings it to the front.


toBack

public void toBack()

Sends this window to the back so that all other windows display in front of it.


toFront

public void toFront()

Brings this window to the front so that it displays in front of any other windows.