Package java.awt Previous
Previous
Java API
Java API
Index
Index
Next
Next

Class Window

Constructors , Methods

public  class  java.awt.Window
    extends  java.awt.Container  
{
        // Constructors
    public Window(Frame  parent);	

        // Methods
    public void addNotify();	
    public void dispose();	
    public Toolkit getToolkit();	
    public final String getWarningString();	
    public void pack();	
    public void show();	
    public void toBack();	
    public void toFront();	
}

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 .


Constructors


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 to cause the window to become visible.

ParameterDescription
parent the main application frame


Methods


addNotify

public void addNotify() 

This method calls the createWindow method of this object's toolkit in order to create a WindowPeer 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 .


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 . However subclasses of Window can override this method in order to create their own toolkits.

Return Value:

Returns the toolkit of this window. .

Overrides:

getToolkit in class Component .


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 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".

Return Value:

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 .

Overrides:

show in class Component .

See Also: hide in class Component .


toBack

public void toBack() 

Sends this window to the back.


toFront

public void toFront() 

Brings this window to the front.



Top© 1996 Sun Microsystems, Inc. All rights reserved.