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

Class Frame

Fields , Constructors , Methods

public  class  java.awt.Frame
    extends  java.awt.Window  
    implements java.awt.MenuContainer  
{
        // possible cursor types for the setCursor method
    public final static int CROSSHAIR_CURSOR;	
    public final static int DEFAULT_CURSOR;	
    public final static int E_RESIZE_CURSOR;	
    public final static int HAND_CURSOR;	
    public final static int MOVE_CURSOR;	
    public final static int N_RESIZE_CURSOR;	
    public final static int NE_RESIZE_CURSOR;	
    public final static int NW_RESIZE_CURSOR;	
    public final static int S_RESIZE_CURSOR;	
    public final static int SE_RESIZE_CURSOR;	
    public final static int SW_RESIZE_CURSOR;	
    public final static int TEXT_CURSOR;	
    public final static int W_RESIZE_CURSOR;	
    public final static int WAIT_CURSOR;	

        // Constructors
    public Frame();	
    public Frame(String  title);	

        // Methods
    public void addNotify();	
    public void dispose();	
    public int getCursorType();	
    public Image getIconImage();	
    public MenuBar getMenuBar();	
    public String getTitle();	
    public boolean isResizable();	
    protected String paramString();	
    public void remove(MenuComponent  m);	
    public void setCursor(int  cursorType);	
    public void setIconImage(Image  image);	
    public void setMenuBar(MenuBar  mb);	
    public void setResizable(boolean  resizable);	
    public void setTitle(String  title);	
}

A frame is a top-level window with a title and a border. A frame can also have a menu bar. The AWT sends the frame all mouse, keyboard, and focus events that occur over it.


Fields


CROSSHAIR_CURSOR

public final static int CROSSHAIR_CURSOR = 1 

A cross-haired shaped cursor.


DEFAULT_CURSOR

public final static int DEFAULT_CURSOR = 0 

The default cursor.


E_RESIZE_CURSOR

public final static int E_RESIZE_CURSOR = 11 

A cursor indicating that the right-hand border is being resized.


HAND_CURSOR

public final static int HAND_CURSOR = 12 

A hand-shaped cursor.


MOVE_CURSOR

public final static int MOVE_CURSOR = 13 

A cursor indicating that an object is being moved.


N_RESIZE_CURSOR

public final static int N_RESIZE_CURSOR = 8 

A cursor indicating that the top border is being resized.


NE_RESIZE_CURSOR

public final static int NE_RESIZE_CURSOR = 7 

A cursor indicating that the top-right corner is being resized.


NW_RESIZE_CURSOR

public final static int NW_RESIZE_CURSOR = 6 

A cursor indicating the the top-left corner is being resized.


S_RESIZE_CURSOR

public final static int S_RESIZE_CURSOR = 9 

A cursor indicating the the bottom edge is being resized.


SE_RESIZE_CURSOR

public final static int SE_RESIZE_CURSOR = 5 

A cursor indicating that the bottom-right edge is being resized.


SW_RESIZE_CURSOR

public final static int SW_RESIZE_CURSOR = 4 

A cursor indicating that the bottom-left edge is being resized.


TEXT_CURSOR

public final static int TEXT_CURSOR = 2 

A cursor for text insertion.


W_RESIZE_CURSOR

public final static int W_RESIZE_CURSOR = 10 

A cursor indicating the the left edge is being resized.


WAIT_CURSOR

public final static int WAIT_CURSOR = 3 

A cursor indicating that a long-running operation is taking place


Constructors


Frame

public Frame() 

Constructs a new frame; it is initially invisible and has no title.


Frame

public Frame(String  title) 

Constructs a new frame; it is initially invisible and has the specified title.

ParameterDescription
title the title


Methods


addNotify

public void addNotify() 

This method calls the createFrame method of this object's toolkit in order to create a FramePeer for this frame. This peer allows the application to change the look of a frame without changing its functionality.

Most applications do not call this method directly.

Overrides:

addNotify in class Window .


dispose

public void dispose() 

Disposes of this frame, its menubar, and any system resources used by this frame.

Overrides:

dispose in class Window .


getCursorType

public int getCursorType() 

Return Value:

Returns the cursor type of this frame.


getIconImage

public Image getIconImage() 

Return Value:

Returns the icon image for this frame, or null if this frame doesn't have an icon image.


getMenuBar

public MenuBar getMenuBar() 

Return Value:

Returns the menu bar for this frame, or null if this frame doesn't have a menu bar.


getTitle

public String getTitle() 

Return Value:

Returns the title of this frame, or null if this frame doesn't have a title

See Also: setTitle .


isResizable

public boolean isResizable() 

Indicates whether this frame is resizable. By default, all frames are resizable.

Return Value:

Returns true if the user can resize this frame; false otherwise.


paramString

protected String paramString() 

Returns the parameter string representing the state of this frame. This string is useful for debugging.

Return Value:

Returns the parameter string of this frame.

Overrides:

paramString in class Container .


remove

public void remove(MenuComponent  m) 

Removes the specified menu bar from this frame.

ParameterDescription
m the menu component to remove.


setCursor

public void setCursor(int  cursorType) 

Sets the cursor image for this frame to be one of the predefined cursors.

ParameterDescription
cursorType one of the predefined cursor constants defined above (CROSSHAIR_CURSOR-WAIT_CURSOR).


setIconImage

public void setIconImage(Image  image) 

Sets the image to display when this frame is iconized. The default icon is platform specific. Not all platforms support the concept of iconizing a window.

ParameterDescription
image the icon image to be displayed


setMenuBar

public void setMenuBar(MenuBar  mb) 

Sets the menubar of this frame to the specified menubar.

ParameterDescription
mb the new menubar


setResizable

public void setResizable(boolean  resizable) 

Determines whether this frame should be resizable. By default, a frame is resizable.

ParameterDescription
resizable true if this frame should be resizable; false otherwise


setTitle

public void setTitle(String  title) 

Sets the title of this frame to the specified title.

ParameterDescription
title the new title of this frame, or null to remove the title

See Also: getTitle .



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