Java java.awt Frame fields, constructors, methods, implement or subclass

Example usage for Java java.awt Frame fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt Frame.

The text is from its open source code.

Subclass

java.awt.Frame has subclasses.
Click this link to see all its subclasses.

Field

intNORMAL
Frame is in the "normal" state.
intICONIFIED
This state bit indicates that frame is iconified.
intMAXIMIZED_HORIZ
This state bit indicates that frame is maximized in the horizontal direction.
intMAXIMIZED_VERT
This state bit indicates that frame is maximized in the vertical direction.
intMAXIMIZED_BOTH
This state bit mask indicates that frame is fully maximized (that is both horizontally and vertically).

Constructor

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.

Method

Componentadd(Component comp)
Appends the specified component to the end of this container.
Componentadd(String name, Component comp)
Adds the specified component to this container.
voidaddComponentListener(ComponentListener l)
Adds the specified component listener to receive component events from this component.
voidaddNotify()
Makes this Frame displayable by connecting it to a native screen resource.
voidaddWindowFocusListener(WindowFocusListener l)
Adds the specified window focus listener to receive window events from this window.
voidaddWindowListener(WindowListener l)
Adds the specified window listener to receive window events from this window.
voidaddWindowStateListener(WindowStateListener l)
Adds the specified window state listener to receive window events from this window.
voidcreateBufferStrategy(int numBuffers)
Creates a new strategy for multi-buffering on this component.
ImagecreateImage(int width, int height)
Creates an off-screen drawable image to be used for double buffering.
voiddispatchEvent(AWTEvent e)
Dispatches an event to this component or one of its sub components.
voiddispose()
Releases all of the native screen resources used by this Window , its subcomponents, and all of its owned children.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
BufferStrategygetBufferStrategy()
Returns the BufferStrategy used by this component.
ClassgetClass()
Returns the runtime class of this Object .
Component[]getComponents()
Gets all the components in this container.
intgetExtendedState()
Gets the state of this frame.
FontMetricsgetFontMetrics(Font font)
Gets the font metrics for the specified font.
Frame[]getFrames()
Returns an array of all Frame s created by this application.
GraphicsConfigurationgetGraphicsConfiguration()
Gets the GraphicsConfiguration associated with this Component .
intgetHeight()
Returns the current height of this component.
ImagegetIconImage()
Returns the image to be displayed as the icon for this frame.
InsetsgetInsets()
Determines the insets of this container, which indicate the size of the container's border.
PointgetLocation()
Gets the location of this component in the form of a point specifying the component's top-left corner.
PointgetLocationOnScreen()
Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space.
StringgetName()
Gets the name of the component.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
StringgetTitle()
Gets the title of the frame.
ToolkitgetToolkit()
Returns the toolkit of this frame.
intgetWidth()
Returns the current width of this component.
intgetX()
Returns the current x coordinate of the components origin.
intgetY()
Returns the current y coordinate of the components origin.
booleanisActive()
Returns whether this Window is active.
booleanisFocused()
Returns whether this Window is focused.
booleanisResizable()
Indicates whether this frame is resizable by the user.
booleanisShowing()
Checks if this Window is showing on screen.
booleanisUndecorated()
Indicates whether this frame is undecorated.
booleanisVisible()
Determines whether this component should be visible when its parent is visible.
voidpack()
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents.
voidremoveWindowFocusListener(WindowFocusListener l)
Removes the specified window focus listener so that it no longer receives window events from this window.
voidremoveWindowListener(WindowListener l)
Removes the specified window listener so that it no longer receives window events from this window.
voidrepaint()
Repaints this component.
voidrequestFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
voidsetBackground(Color bgColor)
voidsetBounds(Rectangle r)

The r.width or r.height values will be automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetCursor(int cursorType)
Sets the cursor for this frame to the specified type.
voidsetEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b .
voidsetExtendedState(int state)
Sets the state of this frame.
voidsetFont(Font f)
Sets the font of this container.
voidsetIconImage(Image image)
voidsetIconImages(java.util.List icons)
Sets the sequence of images to be displayed as the icon for this window.
voidsetIgnoreRepaint(boolean ignoreRepaint)
Sets whether or not paint messages received from the operating system should be ignored.
voidsetLayout(LayoutManager mgr)
Sets the layout manager for this container.
voidsetLocation(int x, int y)

The method changes the geometry-related data.

voidsetLocation(Point p)

The method changes the geometry-related data.

voidsetLocationRelativeTo(Component c)
Sets the location of the window relative to the specified component according to the following scenarios.
voidsetMaximizedBounds(Rectangle bounds)
Sets the maximized bounds for this frame.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetResizable(boolean resizable)
Sets whether this frame is resizable by the user.
voidsetSize(int width, int height)

The width and height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetSize(Dimension d)

The d.width and d.height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetState(int state)
Sets the state of this frame (obsolete).
voidsetTitle(String title)
Sets the title for this frame to the specified string.
voidsetUndecorated(boolean undecorated)
Disables or enables decorations for this frame.
voidsetVisible(boolean b)
Shows or hides this Window depending on the value of parameter b .
voidshow()
Makes the Window visible.
voidtoFront()
If this Window is visible, brings this Window to the front and may make it the focused Window.
voidvalidate()
Validates this container and all of its subcomponents.