Packages This Package Prev Next Index
§1.42 Class Window
public class java.awt.Window
extends java.awt.Container (II-§1.11)
{
// Constructors
public Window(Frame parent); §1.42.1
// Methods
public void addNotify(); §1.42.2
public void dispose(); §1.42.3
public Toolkit getToolkit(); §1.42.4
public final String getWarningString(); §1.42.5
public void pack(); §1.42.6
public void show(); §1.42.7
public void toBack(); §1.42.8
public void toFront(); §1.42.9
}
A Window is a top-level window; it has no borders and no menubar. It could be used, for
example, to implement a pop-up menu. The AWT sends the window all mouse, keyboard,
and focus events that occur over it.
The default layout for a window is BorderLayout (II-§1.1).
Window
public Window(Frame parent)
- Constructs a new invisible window
- The window behaves as a modal dialog in that it will block input to other
application windows when shown.
- Use the show method (II-§1.42.7) to cause the window to become visible.
- Parameters:
parent
-
the main application frame
addNotify
public void addNotify()
- This method calls the createWindow method (II-§1.41.21) of this object's
toolkit (II-§1.10.20) in order to create a WindowPeer (II-§3.22) for this window. This peer allows the application to change the look of a window
without changing its functionality.
- Most applications do not call this method directly.
- Overrides:
- addNotify in class Container (II-§1.11.4).
dispose
public void dispose()
- Disposes of this window and any resources used by this window.
getToolkit
public Toolkit getToolkit()
- Determines the toolkit of this window.
- The implementation of getToolkit in class Window returns the default
toolkit (II-§1.41.23). However subclasses of Window can override this
method in order to create their own toolkits.
- Returns:
- the toolkit of this window. .
- Overrides:
- getToolkit in class Component (II-§1.10.20).
getWarningString
public final String getWarningString()
- Returns 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 its checkTopLevelWindow method (I-§1.15.22) returns false when passed
this window as an argument.
- If the window is secure, then the getWarningString method returns null. If the
window is insecure, this methods checks for a system property awt.appletWarning and returns the string value of that property. If there is no such
property, the default warning string is used instead. The default warning
string is "Warning: Applet Window".
- Returns:
- the warning string for this window.
pack
public void pack()
- Causes the subcomponents of this window to be laid out at their preferred
size.
show
public void show()
- If this window is not yet visible, make it visible. If this window is already
visible, then bring it to the front (II-§1.42.9).
- Overrides:
- show in class Component (II-§1.10.70).
- See Also:
- hide in class Component (II-§1.10.23).
toBack
public void toBack()
- Sends this window to the back.
toFront
public void toFront()
- Brings this window to the front.
Packages This Package Prev Next Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc.
All rights reserved
Please send any comments or corrections to doug.kramer@sun.com