Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.awt
Class Frame  view Frame download Frame.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, MenuContainer, java.io.Serializable

public class Frame
extends Window
implements MenuContainer

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


Nested Class Summary
protected  class Frame.AccessibleAWTFrame
          Accessibility support for Frame.
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer, Container.GfxPaintAllVisitor, Container.GfxPaintVisitor, Container.GfxPrintAllVisitor, Container.GfxPrintVisitor, Container.GfxVisitor
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy, Component.HeavyweightInLightweightListener
 
Field Summary
static int CROSSHAIR_CURSOR
          Deprecated. Use Cursor.CROSSHAIR_CURSOR instead.
static int DEFAULT_CURSOR
          Deprecated. Replaced by Cursor.DEFAULT_CURSOR instead.
static int E_RESIZE_CURSOR
          Deprecated. Use Cursor.E_RESIZE_CURSOR instead.
private  int frameSerializedDataVersion
           
static int HAND_CURSOR
          Deprecated. Use Cursor.HAND_CURSOR instead.
private  Image icon
           
static int ICONIFIED
           
static int MAXIMIZED_BOTH
           
static int MAXIMIZED_HORIZ
           
static int MAXIMIZED_VERT
           
private  Rectangle maximizedBounds
          Maximized bounds for this frame.
private  boolean mbManagement
           
private  MenuBar menuBar
           
static int MOVE_CURSOR
          Deprecated. Use Cursor.MOVE_CURSOR instead.
static int N_RESIZE_CURSOR
          Deprecated. Use Cursor.N_RESIZE_CURSOR instead.
static int NE_RESIZE_CURSOR
          Deprecated. Use Cursor.NE_RESIZE_CURSOR instead.
private static long next_frame_number
           
static int NORMAL
           
static int NW_RESIZE_CURSOR
          Deprecated. Use Cursor.NW_RESIZE_CURSOR instead.
(package private)  java.util.Vector ownedWindows
           
private  boolean resizable
           
static int S_RESIZE_CURSOR
          Deprecated. Use Cursor.S_RESIZE_CURSOR instead.
static int SE_RESIZE_CURSOR
          Deprecated. Use Cursor.SE_RESIZE_CURSOR instead.
private static long serialVersionUID
           
(package private)  int state
           
static int SW_RESIZE_CURSOR
          Deprecated. Use Cursor.SW_RESIZE_CURSOR instead.
static int TEXT_CURSOR
          Deprecated. Use Cursor.TEXT_CURSOR instead.
private  java.lang.String title
           
private  boolean undecorated
          This field indicates whether the frame is undecorated or not.
static int W_RESIZE_CURSOR
          Deprecated. Use Cursor.W_RESIZE_CURSOR instead.
static int WAIT_CURSOR
          Deprecated. Use Cursor.WAIT_CURSOR.
private static java.util.ArrayList weakFrames
           
 
Fields inherited from class java.awt.Window
windowFocusOwner
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, focusCycleRoot, focusTraversalKeys, layoutMgr, maxSize, ncomponents
 
Fields inherited from class java.awt.Component
accessibleContext, background, BOTTOM_ALIGNMENT, bufferStrategy, CENTER_ALIGNMENT, changeSupport, componentListener, componentSerializedDataVersion, cursor, dropTarget, enabled, eventMask, focusable, focusListener, focusTraversalKeysEnabled, font, foreground, graphicsConfig, height, hierarchyBoundsListener, hierarchyListener, ignoreRepaint, inputMethodListener, isFocusTraversableOverridden, isPacked, keyListener, LEFT_ALIGNMENT, locale, minSize, mouseListener, mouseMotionListener, mouseWheelListener, name, nameExplicitlySet, newEventsOnly, orientation, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, TOP_ALIGNMENT, treeLock, valid, visible, width, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Frame()
          Initializes a new instance of Frame that is not visible and has no title.
Frame(GraphicsConfiguration gc)
           
Frame(java.lang.String title)
          Initializes a new instance of Frame that is not visible and has the specified title.
Frame(java.lang.String title, GraphicsConfiguration gc)
           
 
Method Summary
 void addNotify()
          Creates the native peer for this window.
(package private)  java.lang.String generateName()
          Generate a unique name for this frame.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this Frame.
 int getCursorType()
          Deprecated. Use Component.getCursor() instead.
 int getExtendedState()
           
static Frame[] getFrames()
           
 Image getIconImage()
          Returns this frame's icon.
 Rectangle getMaximizedBounds()
          Returns the maximized bounds of this frame.
 MenuBar getMenuBar()
          Returns this frame's menu bar.
 int getState()
           
 java.lang.String getTitle()
          Returns this frame's title string.
private static long getUniqueLong()
           
 boolean isResizable()
          Tests whether or not this frame is resizable.
 boolean isUndecorated()
          Returns whether this frame is undecorated or not.
private static void noteFrame(Frame f)
           
protected  java.lang.String paramString()
          Returns a debugging string describing this window.
 void remove(MenuComponent menu)
          Removes the specified menu component from this frame.
 void removeNotify()
          Called when this container is removed from its parent container to inform it to destroy its peer.
 void setCursor(int type)
          Deprecated. Use Component.setCursor(Cursor) instead.
 void setExtendedState(int state)
           
 void setIconImage(Image icon)
          Sets this frame's icon to the specified value.
 void setMaximizedBounds(Rectangle maximizedBounds)
           
 void setMenuBar(MenuBar menuBar)
          Sets this frame's menu bar.
 void setResizable(boolean resizable)
          Sets the resizability of this frame to the specified value.
 void setState(int state)
           
 void setTitle(java.lang.String title)
          Sets this frame's title to the specified value.
 void setUndecorated(boolean undecorated)
          Disables or enables decorations for this frame.
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispatchEventImpl, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getGraphicsConfigurationImpl, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setFocusOwner, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, eventTypeEnabled, findComponentAt, findComponentAt, findNextFocusComponent, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, invalidateTree, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setPeer, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, translateEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

DEFAULT_CURSOR

public static final int DEFAULT_CURSOR
Deprecated. Replaced by Cursor.DEFAULT_CURSOR instead.

Constant for the default cursor.

See Also:
Constant Field Values

CROSSHAIR_CURSOR

public static final int CROSSHAIR_CURSOR
Deprecated. Use Cursor.CROSSHAIR_CURSOR instead.

Constant for a cross-hair cursor.

See Also:
Constant Field Values

TEXT_CURSOR

public static final int TEXT_CURSOR
Deprecated. Use Cursor.TEXT_CURSOR instead.

Constant for a cursor over a text field.

See Also:
Constant Field Values

WAIT_CURSOR

public static final int WAIT_CURSOR
Deprecated. Use Cursor.WAIT_CURSOR.

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

See Also:
Constant Field Values

SW_RESIZE_CURSOR

public static final int SW_RESIZE_CURSOR
Deprecated. Use Cursor.SW_RESIZE_CURSOR instead.

Cursor used over SW corner of window decorations.

See Also:
Constant Field Values

SE_RESIZE_CURSOR

public static final int SE_RESIZE_CURSOR
Deprecated. Use Cursor.SE_RESIZE_CURSOR instead.

Cursor used over SE corner of window decorations.

See Also:
Constant Field Values

NW_RESIZE_CURSOR

public static final int NW_RESIZE_CURSOR
Deprecated. Use Cursor.NW_RESIZE_CURSOR instead.

Cursor used over NW corner of window decorations.

See Also:
Constant Field Values

NE_RESIZE_CURSOR

public static final int NE_RESIZE_CURSOR
Deprecated. Use Cursor.NE_RESIZE_CURSOR instead.

Cursor used over NE corner of window decorations.

See Also:
Constant Field Values

N_RESIZE_CURSOR

public static final int N_RESIZE_CURSOR
Deprecated. Use Cursor.N_RESIZE_CURSOR instead.

Cursor used over N edge of window decorations.

See Also:
Constant Field Values

S_RESIZE_CURSOR

public static final int S_RESIZE_CURSOR
Deprecated. Use Cursor.S_RESIZE_CURSOR instead.

Cursor used over S edge of window decorations.

See Also:
Constant Field Values

E_RESIZE_CURSOR

public static final int E_RESIZE_CURSOR
Deprecated. Use Cursor.E_RESIZE_CURSOR instead.

Cursor used over E edge of window decorations.

See Also:
Constant Field Values

W_RESIZE_CURSOR

public static final int W_RESIZE_CURSOR
Deprecated. Use Cursor.W_RESIZE_CURSOR instead.

Cursor used over W edge of window decorations.

See Also:
Constant Field Values

HAND_CURSOR

public static final int HAND_CURSOR
Deprecated. Use Cursor.HAND_CURSOR instead.

Constant for a hand cursor.

See Also:
Constant Field Values

MOVE_CURSOR

public static final int MOVE_CURSOR
Deprecated. Use Cursor.MOVE_CURSOR instead.

Constant for a cursor used during window move operations.

See Also:
Constant Field Values

ICONIFIED

public static final int ICONIFIED
See Also:
Constant Field Values

MAXIMIZED_BOTH

public static final int MAXIMIZED_BOTH
See Also:
Constant Field Values

MAXIMIZED_HORIZ

public static final int MAXIMIZED_HORIZ
See Also:
Constant Field Values

MAXIMIZED_VERT

public static final int MAXIMIZED_VERT
See Also:
Constant Field Values

NORMAL

public static final int NORMAL
See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

frameSerializedDataVersion

private int frameSerializedDataVersion

icon

private Image icon

mbManagement

private boolean mbManagement

menuBar

private MenuBar menuBar

ownedWindows

java.util.Vector ownedWindows

resizable

private boolean resizable

state

int state

title

private java.lang.String title

maximizedBounds

private Rectangle maximizedBounds
Maximized bounds for this frame.


undecorated

private boolean undecorated
This field indicates whether the frame is undecorated or not.


next_frame_number

private static transient long next_frame_number

weakFrames

private static java.util.ArrayList weakFrames
Constructor Detail

Frame

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


Frame

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


Frame

public Frame(GraphicsConfiguration gc)

Frame

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

getTitle

public java.lang.String getTitle()
Returns this frame's title string.


setTitle

public void setTitle(java.lang.String title)
Sets this frame's title to the specified value.


getIconImage

public Image getIconImage()
Returns this frame's icon.


setIconImage

public void setIconImage(Image icon)
Sets this frame's icon to the specified value.


getMenuBar

public MenuBar getMenuBar()
Returns this frame's menu bar.


setMenuBar

public void setMenuBar(MenuBar menuBar)
Sets this frame's menu bar. Removes any existing menu bar. If the given menu bar is part of another frame it will be removed from that frame.


isResizable

public boolean isResizable()
Tests whether or not this frame is resizable. This will be true by default.


setResizable

public void setResizable(boolean resizable)
Sets the resizability of this frame to the specified value.


getCursorType

public int getCursorType()
Deprecated. Use Component.getCursor() instead.

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


setCursor

public void setCursor(int type)
Deprecated. Use Component.setCursor(Cursor) instead.

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


remove

public void remove(MenuComponent menu)
Removes the specified menu component from this frame. If it is the current MenuBar it is removed from the frame. If it is a Popup it is removed from this component. If it is any other menu component it is ignored.

Specified by:
remove in interface MenuContainer
Overrides:
remove in class Component

addNotify

public void addNotify()
Description copied from class: Window
Creates the native peer for this window.

Overrides:
addNotify in class Window

removeNotify

public void removeNotify()
Description copied from class: Container
Called when this container is removed from its parent container to inform it to destroy its peer. This causes the peers of all child component to be destroyed as well.

Overrides:
removeNotify in class Container

paramString

protected java.lang.String paramString()
Returns a debugging string describing this window.

Overrides:
paramString in class Container

noteFrame

private static void noteFrame(Frame f)

getFrames

public static Frame[] getFrames()

setState

public void setState(int state)

getState

public int getState()

setExtendedState

public void setExtendedState(int state)
Since:
1.4

getExtendedState

public int getExtendedState()
Since:
1.4

setMaximizedBounds

public void setMaximizedBounds(Rectangle maximizedBounds)
Since:
1.4

getMaximizedBounds

public Rectangle getMaximizedBounds()
Returns the maximized bounds of this frame.

Since:
1.4

isUndecorated

public boolean isUndecorated()
Returns whether this frame is undecorated or not.

Since:
1.4

setUndecorated

public void setUndecorated(boolean undecorated)
Disables or enables decorations for this frame. This method can only be called while the frame is not displayable.

Since:
1.4

generateName

java.lang.String generateName()
Generate a unique name for this frame.

Overrides:
generateName in class Window

getUniqueLong

private static long getUniqueLong()

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this Frame. The context is created, if necessary.

Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class Window