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

Class Frame

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

All Implemented Interfaces:

MenuContainer, ImageObserver, MenuContainer, Serializable


public class Frame

extends Window

implements MenuContainer

This class is a top-level window with a title bar and window decorations.

Author:

Field Summary

static intCROSSHAIR_CURSOR

Constant for a cross-hair cursor.
static intDEFAULT_CURSOR

Constant for the default cursor.
static intE_RESIZE_CURSOR

Cursor used over E edge of window decorations.
static intHAND_CURSOR

Constant for a hand cursor.
static intICONIFIED

static intMAXIMIZED_BOTH

static intMAXIMIZED_HORIZ

static intMAXIMIZED_VERT

static intMOVE_CURSOR

Constant for a cursor used during window move operations.
static intNE_RESIZE_CURSOR

Cursor used over NE corner of window decorations.
static intNORMAL

static intNW_RESIZE_CURSOR

Cursor used over NW corner of window decorations.
static intN_RESIZE_CURSOR

Cursor used over N edge of window decorations.
static intSE_RESIZE_CURSOR

Cursor used over SE corner of window decorations.
static intSW_RESIZE_CURSOR

Cursor used over SW corner of window decorations.
static intS_RESIZE_CURSOR

Cursor used over S edge of window decorations.
static intTEXT_CURSOR

Constant for a cursor over a text field.
static intWAIT_CURSOR

Constant for a cursor to display while waiting for an action to complete.
static intW_RESIZE_CURSOR

Cursor used over W edge of window decorations.

Constructor Summary

Frame()

Initializes a new instance of Frame that is not visible and has no title.
Frame(java.lang.String title)

Initializes a new instance of Frame that is not visible and has the specified title.
Frame(java.awt.GraphicsConfiguration gc)

Frame(java.lang.String title, java.awt.GraphicsConfiguration gc)

Method Summary

voidaddNotify()

Notifies this frame that it should create its native peer.
voiddispose()

Destroys any resources associated with this frame.
intgetCursorType()

Returns the cursor type of the cursor for this window.
static java.awt.Frame[]getFrames()

java.awt.ImagegetIconImage()

Returns this frame's icon.
java.awt.MenuBargetMenuBar()

Returns this frame's menu bar.
intgetState()

java.lang.StringgetTitle()

Returns this frame's title string.
booleanisResizable()

Tests whether or not this frame is resizable.
java.lang.StringparamString()

Returns a debugging string describing this window.
voidremove(java.awt.MenuComponent menu)

Removes the specified component from this frame's menu.
voidsetCursor(int type)

Sets the cursor for this window to the specified type.
synchronized voidsetIconImage(java.awt.Image icon)

Sets this frame's icon to the specified value.
synchronized voidsetMenuBar(java.awt.MenuBar menuBar)

Sets this frame's menu bar.
synchronized voidsetResizable(boolean resizable)

Sets the resizability of this frame to the specified value.
synchronized voidsetTitle(java.lang.String title)

Field Details

CROSSHAIR_CURSOR

public static final int CROSSHAIR_CURSOR

Constant for a cross-hair cursor.


DEFAULT_CURSOR

public static final int DEFAULT_CURSOR

Constant for the default cursor. Deprecated. replaced by Cursor.DEFAULT_CURSOR instead.


E_RESIZE_CURSOR

public static final int E_RESIZE_CURSOR

Cursor used over E edge of window decorations.


HAND_CURSOR

public static final int HAND_CURSOR

Constant for a hand cursor.


ICONIFIED

public static final int ICONIFIED


MAXIMIZED_BOTH

public static final int MAXIMIZED_BOTH


MAXIMIZED_HORIZ

public static final int MAXIMIZED_HORIZ


MAXIMIZED_VERT

public static final int MAXIMIZED_VERT


MOVE_CURSOR

public static final int MOVE_CURSOR

Constant for a cursor used during window move operations.


NE_RESIZE_CURSOR

public static final int NE_RESIZE_CURSOR

Cursor used over NE corner of window decorations.


NORMAL

public static final int NORMAL


NW_RESIZE_CURSOR

public static final int NW_RESIZE_CURSOR

Cursor used over NW corner of window decorations.


N_RESIZE_CURSOR

public static final int N_RESIZE_CURSOR

Cursor used over N edge of window decorations.


SE_RESIZE_CURSOR

public static final int SE_RESIZE_CURSOR

Cursor used over SE corner of window decorations.


SW_RESIZE_CURSOR

public static final int SW_RESIZE_CURSOR

Cursor used over SW corner of window decorations.


S_RESIZE_CURSOR

public static final int S_RESIZE_CURSOR

Cursor used over S edge of window decorations.


TEXT_CURSOR

public static final int TEXT_CURSOR

Constant for a cursor over a text field.


WAIT_CURSOR

public static final int WAIT_CURSOR

Constant for a cursor to display while waiting for an action to complete.


W_RESIZE_CURSOR

public static final int W_RESIZE_CURSOR

Cursor used over W edge of window decorations.


Constructor Details

Frame

public Frame()

Initializes a new instance of Frame that is not visible and has no title.


Frame

public Frame(java.awt.GraphicsConfiguration gc)

Parameters:


Frame

public Frame(java.lang.String title)

Initializes a new instance of Frame that is not visible and has the specified title.

Parameters:


Frame

public Frame(java.lang.String title, java.awt.GraphicsConfiguration gc)

Parameters:


Method Details

addNotify

public void addNotify()

Notifies this frame that it should create its native peer.


dispose

public void dispose()

Destroys any resources associated with this frame. This includes all components in the frame and all owned toplevel windows.


getCursorType

public int getCursorType()

Returns the cursor type of the cursor for this window. This will be one of the constants in this class.

Returns:


getFrames

public static Frame[] getFrames()


getIconImage

public Image getIconImage()

Returns this frame's icon.

Returns:


getMenuBar

public MenuBar getMenuBar()

Returns this frame's menu bar.

Returns:


getState

public int getState()


getTitle

public String getTitle()

Returns this frame's title string.

Returns:


isResizable

public boolean isResizable()

Tests whether or not this frame is resizable. This will be true by default.

Returns:


paramString

protected String paramString()

Returns a debugging string describing this window.

Returns:


remove

public void remove(java.awt.MenuComponent menu)

Removes the specified component from this frame's menu.

Parameters:


setCursor

public void setCursor(int type)

Sets the cursor for this window to the specified type. The specified type should be one of the constants in this class.

Parameters:


setIconImage

public synchronized void setIconImage(java.awt.Image icon)

Sets this frame's icon to the specified value.

Parameters:


setMenuBar

public synchronized void setMenuBar(java.awt.MenuBar menuBar)

Sets this frame's menu bar.

Parameters:


setResizable

public synchronized void setResizable(boolean resizable)

Sets the resizability of this frame to the specified value.

Parameters:


setTitle

public synchronized void setTitle(java.lang.String title)

Parameters: