GeezerVison is showing docs.oracle.com — Frame (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
-
-
Nested Class Summary
Nested Classes
| Modifier and Type |
Class |
Description |
protected class |
Frame.AccessibleAWTFrame |
This class implements accessibility support for the
Frame class.
|
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
static int |
CROSSHAIR_CURSOR |
Deprecated.
replaced by Cursor.CROSSHAIR_CURSOR.
|
static int |
DEFAULT_CURSOR |
Deprecated.
replaced by Cursor.DEFAULT_CURSOR.
|
static int |
E_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.E_RESIZE_CURSOR.
|
static int |
HAND_CURSOR |
Deprecated.
replaced by Cursor.HAND_CURSOR.
|
static int |
ICONIFIED |
This state bit indicates that frame is iconified.
|
static int |
MAXIMIZED_BOTH |
This state bit mask indicates that frame is fully maximized
(that is both horizontally and vertically).
|
static int |
MAXIMIZED_HORIZ |
This state bit indicates that frame is maximized in the
horizontal direction.
|
static int |
MAXIMIZED_VERT |
This state bit indicates that frame is maximized in the
vertical direction.
|
static int |
MOVE_CURSOR |
Deprecated.
replaced by Cursor.MOVE_CURSOR.
|
static int |
N_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.N_RESIZE_CURSOR.
|
static int |
NE_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.NE_RESIZE_CURSOR.
|
static int |
NORMAL |
Frame is in the "normal" state.
|
static int |
NW_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.NW_RESIZE_CURSOR.
|
static int |
S_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.S_RESIZE_CURSOR.
|
static int |
SE_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.SE_RESIZE_CURSOR.
|
static int |
SW_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.SW_RESIZE_CURSOR.
|
static int |
TEXT_CURSOR |
Deprecated.
replaced by Cursor.TEXT_CURSOR.
|
static int |
W_RESIZE_CURSOR |
Deprecated.
replaced by Cursor.W_RESIZE_CURSOR.
|
static int |
WAIT_CURSOR |
Deprecated.
replaced by Cursor.WAIT_CURSOR.
|
-
Constructor Summary
Constructors
| Constructor |
Description |
Frame() |
Constructs a new instance of Frame that is
initially invisible.
|
Frame(GraphicsConfiguration gc) |
Constructs a new, initially invisible Frame with the
specified GraphicsConfiguration.
|
Frame(String title) |
Constructs a new, initially invisible Frame object
with the specified title.
|
Frame(String title,
GraphicsConfiguration gc) |
Constructs a new, initially invisible Frame object
with the specified title and a
GraphicsConfiguration.
|
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
| Modifier and Type |
Method |
Description |
void |
addNotify() |
Makes this Frame displayable by connecting it to
a native screen resource.
|
AccessibleContext |
getAccessibleContext() |
Gets the AccessibleContext associated with this Frame.
|
int |
getCursorType() |
Deprecated.
As of JDK version 1.1,
replaced by Component.getCursor().
|
int |
getExtendedState() |
Gets the state of this frame.
|
static Frame[] |
getFrames() |
Returns an array of all Frames created by this application.
|
Image |
getIconImage() |
Returns the image to be displayed as the icon for this frame.
|
Rectangle |
getMaximizedBounds() |
Gets maximized bounds for this frame.
|
MenuBar |
getMenuBar() |
Gets the menu bar for this frame.
|
int |
getState() |
Gets the state of this frame (obsolete).
|
String |
getTitle() |
Gets the title of the frame.
|
boolean |
isResizable() |
Indicates whether this frame is resizable by the user.
|
boolean |
isUndecorated() |
Indicates whether this frame is undecorated.
|
protected String |
paramString() |
Returns a string representing the state of this Frame.
|
void |
remove(MenuComponent m) |
Removes the specified menu bar from this frame.
|
void |
removeNotify() |
Makes this Frame undisplayable by removing its connection
to its native screen resource.
|
void |
setBackground(Color bgColor) |
Sets the background color of this window.
|
void |
setCursor(int cursorType) |
Deprecated.
As of JDK version 1.1,
replaced by Component.setCursor(Cursor).
|
void |
setExtendedState(int state) |
Sets the state of this frame.
|
void |
setIconImage(Image image) |
Sets the image to be displayed as the icon for this window.
|
void |
setMaximizedBounds(Rectangle bounds) |
Sets the maximized bounds for this frame.
|
void |
setMenuBar(MenuBar mb) |
Sets the menu bar for this frame to the specified menu bar.
|
void |
setOpacity(float opacity) |
Sets the opacity of the window.
|
void |
setResizable(boolean resizable) |
Sets whether this frame is resizable by the user.
|
void |
setShape(Shape shape) |
Sets the shape of the window.
|
void |
setState(int state) |
Sets the state of this frame (obsolete).
|
void |
setTitle(String title) |
Sets the title for this frame to the specified string.
|
void |
setUndecorated(boolean undecorated) |
Disables or enables decorations for this frame.
|
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
Method Detail
-
isResizable
public boolean isResizable()
Indicates whether this frame is resizable by the user.
By default, all frames are initially resizable.
- Returns:
true if the user can resize this frame;
false otherwise.
- See Also:
setResizable(boolean)
-
getState
public int getState()
Gets the state of this frame (obsolete).
In older versions of JDK a frame state could only be NORMAL or
ICONIFIED. Since JDK 1.4 set of supported frame states is
expanded and frame state is represented as a bitwise mask.
For compatibility with old programs this method still returns
Frame.NORMAL and Frame.ICONIFIED but
it only reports the iconic state of the frame, other aspects of
frame state are not reported by this method.
- Returns:
Frame.NORMAL or Frame.ICONIFIED.
- See Also:
setState(int),
getExtendedState()
-
isUndecorated
public boolean isUndecorated()
Indicates whether this frame is undecorated.
By default, all frames are initially decorated.
- Returns:
true if frame is undecorated;
false otherwise.
- Since:
- 1.4
- See Also:
setUndecorated(boolean)
-
removeNotify
public void removeNotify()
Makes this Frame undisplayable by removing its connection
to its native screen resource. Making a Frame undisplayable
will cause any of its children to be made undisplayable.
This method is called by the toolkit internally and should
not be called directly by programs.
- Overrides:
removeNotify in class Window
- See Also:
Component.isDisplayable(),
addNotify()
-
paramString
protected String paramString()
Returns a string representing the state of this Frame.
This method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null.
- Overrides:
paramString in class Container
- Returns:
- the parameter string of this frame
-
setCursor
@Deprecated
public void setCursor(int cursorType)
Deprecated. As of JDK version 1.1,
replaced by Component.setCursor(Cursor).
-
getCursorType
@Deprecated
public int getCursorType()
Deprecated. As of JDK version 1.1,
replaced by Component.getCursor().
-
getAccessibleContext
public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this Frame.
For frames, the AccessibleContext takes the form of an
AccessibleAWTFrame.
A new AccessibleAWTFrame instance is created if necessary.
- Specified by:
getAccessibleContext in interface Accessible
- Overrides:
getAccessibleContext in class Window
- Returns:
- an AccessibleAWTFrame that serves as the
AccessibleContext of this Frame
- Since:
- 1.3
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|