The size of the frame includes any area designated for the
border. The dimensions of the border area may be obtained
using the getInsets method, however, since
these dimensions are platform-dependent, a valid insets
value cannot be obtained until the frame is made displayable
by either calling pack or show.
Since the border area is included in the overall size of the
frame, the border effectively obscures a portion of the frame,
constraining the area available for rendering and/or displaying
subcomponents to the rectangle which has an upper-left corner
location of (insets.left, insets.top), and has a size of
width - (insets.left + insets.right) by
height - (insets.top + insets.bottom).

The default layout for a frame is BorderLayout.

A frame may have its native decorations (i.e. Frame
and Titlebar) turned off
with setUndecorated. This can only be done while the frame
is not displayable.

In a virtual device multi-screen environment in which the desktop
area could span multiple physical screen devices, the bounds of all
configurations are relative to the virtual-coordinate system. The
origin of the virtual-coordinate system is at the upper left-hand
corner of the primary physical screen. Depending on the location
of the primary screen in the virtual device, negative coordinates
are possible, as shown in the following figure.

In such an environment, when calling setLocation,
you must pass a virtual coordinate to this method. Similarly,
calling getLocationOnScreen on a Frame
returns virtual device coordinates. Call the getBounds
method of a GraphicsConfiguration to find its origin in
the virtual coordinate system.

The following code sets the
location of the Frame at (10, 10) relative
to the origin of the physical screen of the corresponding
GraphicsConfiguration. If the bounds of the
GraphicsConfiguration is not taken into account, the
Frame location would be set at (10, 10) relative to the
virtual-coordinate system and would appear on the primary physical
screen, which might be different from the physical screen of the
specified GraphicsConfiguration.

addNotify

public void addNotify()

Makes this Frame displayable by connecting it to
a native screen resource. Making a frame displayable will
cause any of its children to be made displayable.
This method is called internally by the toolkit and should
not be called directly by programs.

Note : Native windowing systems may use different images of differing
dimensions to represent a window, depending on the context (e.g.
window decoration, window list, taskbar, etc.). They could also use
just a single image for all contexts or no image at all.

setState

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 accepts
Frame.NORMAL and Frame.ICONIFIED but
it only changes the iconic state of the frame, other aspects of
frame state are not affected by this method.

setExtendedState

Sets the state of this frame. The state is
represented as a bitwise mask.

NORMALIndicates that no state bits are set.

ICONIFIED

MAXIMIZED_HORIZ

MAXIMIZED_VERT

MAXIMIZED_BOTHConcatenates MAXIMIZED_HORIZ
and MAXIMIZED_VERT.

Note that if the state is not supported on a
given platform, nothing will happen. The application
may determine if a specific state is available via
the java.awt.Toolkit#isFrameStateSupported(int state)
method.

getState

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.

setMaximizedBounds

When a frame is in maximized state the system supplies some
defaults bounds. This method allows some or all of those
system supplied values to be overridden.

If bounds is null, accept bounds
supplied by the system. If non-null you can
override some of the system supplied values while accepting
others by setting those fields you want to accept from system
to Integer.MAX_VALUE.

On some systems only the size portion of the bounds is taken
into account.

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.

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.

getCursorType

getFrames

Returns an array of all Frames created by this application.
If called from an applet, the array includes only the Frames
accessible by that applet.

Warning: this method may return system created frames, such
as a shared, hidden frame which is used by Swing. Applications
should not assume the existence of these frames, nor should an
application assume anything about these frames such as component
positions, LayoutManagers or serialization.

Note: To obtain a list of all ownerless windows, including
ownerless Dialogs (introduced in release 1.6), use Window.getOwnerlessWindows.

Submit a bug or featureFor further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.