Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.Window

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----java.awt.Window
Subclasses:
Dialog, Frame, JWindow

public class Window
extends Container
A Window object is a top-level window with no borders and no menubar. The default layout for a window is BorderLayout.

Windows are capable of generating the following window events: WindowOpened, WindowClosed.

Since:
JDK1.0
See Also:
WindowEvent, addWindowListener, BorderLayout

Fields inherited from class java.awt.Component
 BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 

Constructor Summary
 Window(Frame owner)
Constructs a new invisible window.
 Window(Window owner)
Constructs a new invisible window with the specified window as its owner.
 

Method Summary
void  addNotify()
Creates the Window's peer.
void  addWindowListener(WindowListener l)
Adds the specified window listener to receive window events from this window.
void  dispose()
Disposes of this window.
Component  getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active.
InputContext  getInputContext()
Gets the input context for this window.
Locale  getLocale()
Gets the Locale object that is associated with this window, if the locale has been set.
Window[]  getOwnedWindows()
Return an array containing all the windows this window currently owns.
Window  getOwner()
Returns the owner of this window.
Toolkit  getToolkit()
Returns the toolkit of this frame.
String  getWarningString()
Gets the warning string that is displayed with this window.
boolean  isShowing()
Checks if this Window is showing on screen.
void  pack()
Causes subcomponents of this window to be laid out at their preferred size.
boolean  postEvent(Event e)
  Deprecated
void  processEvent(AWTEvent e)
Processes events on this window.
void  processWindowEvent(WindowEvent e)
Processes window events occurring on this window by dispatching them to any registered WindowListener objects.
void  removeWindowListener(WindowListener l)
Removes the specified window listener so that it no longer receives window events from this window.
void  show()
Shows this window, and brings it to the front.
void  toBack()
Sends this window to the back.
void  toFront()
Brings this window to the front.
 
Methods inherited from class java.awt.Container
 add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
 action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Window

public Window(Frame owner)
Constructs a new invisible window.

The window is not initially visible. Call the show method to cause the window to become visible.

Parameters:
owner - the main application frame.
See Also:
show, setSize

Window

public Window(Window owner)
Constructs a new invisible window with the specified window as its owner.
Parameters:
owner - the window to act as owner
Method Detail

addNotify

public void addNotify()
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

pack

public void pack()
Causes subcomponents of this window to be laid out at their preferred size.

show

public void show()
Shows this window, and brings it to the front.

If this window is not yet visible, show makes it visible. If this window is already visible, then this method brings it to the front.

Overrides:
show in class Component
See Also:
toFront, setVisible

dispose

public void dispose()
Disposes of this window. This method must be called to release the resources that are used for the window. This method will automatically dispose any Windows which this window currently owns.

toFront

public void toFront()
Brings this window to the front. Places this window at the top of the stacking order and shows it in front of any other windows.
See Also:
toBack

toBack

public void toBack()
Sends this window to the back. Places this window at the bottom of the stacking order and makes the corresponding adjustment to other visible windows.
See Also:
toFront

getToolkit

public Toolkit getToolkit()
Returns the toolkit of this frame.
Returns:
the toolkit of this window.
Overrides:
getToolkit in class Component
See Also:
Toolkit, getDefaultToolkit(), getToolkit()

getWarningString

public final String getWarningString()
Gets the warning string that is displayed with this window. If this window is insecure, the warning string is displayed somewhere in the visible area of the window. A window is insecure if there is a security manager, and the security manager's checkTopLevelWindow method returns false when this window is passed to it as an argument.

If the window is secure, then getWarningString returns null. If the window is insecure, this methods checks for the system property awt.appletWarning and returns the string value of that property.

Returns:
the warning string for this window.
See Also:
checkTopLevelWindow(java.lang.Object)

getLocale

public Locale getLocale()
Gets the Locale object that is associated with this window, if the locale has been set. If no locale has been set, then the default locale is returned.
Returns:
the locale that is set for this window.
Overrides:
getLocale in class Component
See Also:
Locale

getInputContext

public InputContext getInputContext()
Gets the input context for this window. A window always has an input context, which is shared by subcomponents unless they create and set their own.
Overrides:
getInputContext in class Component
See Also:
getInputContext

getOwner

public Window getOwner()
Returns the owner of this window.

getOwnedWindows

public Window[] getOwnedWindows()
Return an array containing all the windows this window currently owns.

addWindowListener

public void addWindowListener(WindowListener l)
Adds the specified window listener to receive window events from this window.
Parameters:
l - the window listener

removeWindowListener

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

processEvent

protected void processEvent(AWTEvent e)
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

processWindowEvent

protected void processWindowEvent(WindowEvent e)
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

getFocusOwner

public Component getFocusOwner()
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.

postEvent

public boolean postEvent(Event e)
Note: postEvent() is deprecated.As of JDK version 1.1 replaced by dispatchEvent(AWTEvent).

Overrides:
postEvent in class Component

isShowing

public boolean isShowing()
Checks if this Window is showing on screen.
Overrides:
isShowing in class Component
See Also:
setVisible(boolean)

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.