Packages This Package Prev Next Index
§1.19 Class Frame
public class java.awt.Frame
extends java.awt.Window (II-§1.42)
implements java.awt.MenuContainer (II-§1.44)
{
// possible cursor types for the setCursor method
public final static int CROSSHAIR_CURSOR; §1.19.1
public final static int DEFAULT_CURSOR; §1.19.2
public final static int E_RESIZE_CURSOR; §1.19.3
public final static int HAND_CURSOR; §1.19.4
public final static int MOVE_CURSOR; §1.19.5
public final static int N_RESIZE_CURSOR; §1.19.6
public final static int NE_RESIZE_CURSOR; §1.19.7
public final static int NW_RESIZE_CURSOR; §1.19.8
public final static int S_RESIZE_CURSOR; §1.19.9
public final static int SE_RESIZE_CURSOR; §1.19.10
public final static int SW_RESIZE_CURSOR; §1.19.11
public final static int TEXT_CURSOR; §1.19.12
public final static int W_RESIZE_CURSOR; §1.19.13
public final static int WAIT_CURSOR; §1.19.14
// Constructors
public Frame(); §1.19.15
public Frame(String title); §1.19.16
// Methods
public void addNotify(); §1.19.17
public void dispose(); §1.19.18
public int getCursorType(); §1.19.19
public Image getIconImage(); §1.19.20
public MenuBar getMenuBar(); §1.19.21
public String getTitle(); §1.19.22
public boolean isResizable(); §1.19.23
protected String paramString(); §1.19.24
public void remove(MenuComponent m); §1.19.25
public void setCursor(int cursorType); §1.19.26
public void setIconImage(Image image); §1.19.27
public void setMenuBar(MenuBar mb); §1.19.28
public void setResizable(boolean resizable); §1.19.29
public void setTitle(String title); §1.19.30
}
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.
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
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.
- Parameters:
title
- the title
addNotify
public void addNotify()
- This method calls the createFrame method (II-§1.41.10) of this object's
toolkit (II-§1.10.20) in order to create a FramePeer (II-§3.10) 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 (II-§1.42.2).
dispose
public void dispose()
- Disposes of this frame, its menubar, and any system resources used by this
frame.
- Overrides:
- dispose in class Window (II-§1.42.3).
getCursorType
public int getCursorType()
- Returns:
- the cursor type of this frame.
getIconImage
public Image getIconImage()
- Returns:
- the icon image for this frame, or null if this frame doesn't have an icon
image.
getMenuBar
public MenuBar getMenuBar()
- Returns:
- the menu bar for this frame, or null if this frame doesn't have a menu
bar.
getTitle
public String getTitle()
- Returns:
- the title of this frame, or null if this frame doesn't have a title
- See Also:
- setTitle (II-§1.19.30).
isResizable
public boolean isResizable()
- Indicates whether this frame is resizable. By default, all frames are resizable.
- 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.
- Returns:
- the parameter string of this frame.
- Overrides:
- paramString in class Container (II-§1.11.16).
remove
public void remove(MenuComponent m)
- Removes the specified menu bar from this frame.
- Parameters:
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.
- Parameters:
cursorType
- one of the predefined cursor constants defined above
(II-§1.19.1-§1.19.14).
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.
- Parameters:
image
- the icon image to be displayed
setMenuBar
public void setMenuBar(MenuBar mb)
- Sets the menubar of this frame to the specified menubar.
- Parameters:
mb
- the new menubar
setResizable
public void setResizable(boolean resizable)
- Determines whether this frame should be resizable. By default, a frame is
resizable.
- Parameters:
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.
- Parameters:
title
- the new title of this frame, or null to remove the title
- See Also:
- getTitle (II-§1.19.22).
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