APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.awt

public abstract Class Component

extends Object
implements ImageObserver, MenuContainer, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.awt.MenuContainer, java.awt.image.ImageObserver
Known Direct Subclasses
java.awt.Container, java.awt.Label, java.awt.List, java.awt.Checkbox, java.awt.Scrollbar, java.awt.TextComponent, sun.awt.X11.XEmbedChildProxy, java.awt.Button, java.awt.Canvas, java.awt.Choice
Imports
java.awt.dnd.DropTarget, java.awt.event.ActionEvent, .AdjustmentEvent, .ComponentEvent, .ComponentListener, .FocusEvent, .FocusListener, .HierarchyBoundsListener, .HierarchyEvent, .HierarchyListener, .InputEvent, .InputMethodEvent, .InputMethodListener, .ItemEvent, .KeyEvent, .KeyListener, .MouseEvent, .MouseListener, .MouseMotionListener, .MouseWheelEvent, .MouseWheelListener, .PaintEvent, .TextEvent, java.awt.im.InputContext, .InputMethodRequests, java.awt.image.BufferStrategy, .ColorModel, .ImageObserver, .ImageProducer, .VolatileImage, java.awt.peer.ComponentPeer, .ContainerPeer, .LightweightPeer, java.beans.PropertyChangeListener, .PropertyChangeSupport, .Transient, java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .PrintStream, .PrintWriter, .Serial, .Serializable, java.util.Collections, .EventListener, .HashSet, .Locale, .Map, .Objects, .Set, .Vector, javax.accessibility.Accessible, .AccessibleComponent, .AccessibleContext, .AccessibleRole, .AccessibleSelection, .AccessibleState, .AccessibleStateSet, javax.swing.JComponent, .JRootPane, sun.awt.AWTAccessor, .ComponentFactory, .ConstrainableGraphics, .EmbeddedFrame, .RequestFocusController, .SubRegionShowable, .SunToolkit, sun.awt.dnd.SunDropTargetEvent, sun.awt.im.CompositionArea, sun.awt.image.VSyncedBSManager, sun.font.FontManager, .FontManagerFactory, .SunFontManager, sun.java2d.SunGraphics2D, .SunGraphicsEnvironment, sun.java2d.pipe.Region, sun.java2d.pipe.hw.ExtendedBufferCapabilities, sun.swing.SwingAccessor, sun.util.logging.PlatformLogger

A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user. Examples of components are the buttons, checkboxes, and scrollbars of a typical graphical user interface.

The Component class is the abstract superclass of the nonmenu-related Abstract Window Toolkit components. Class Component can also be extended directly to create a lightweight component. A lightweight component is a component that is not associated with a native window. On the contrary, a heavyweight component is associated with a native window. The isLightweight() method may be used to distinguish between the two kinds of the components.

Lightweight and heavyweight components may be mixed in a single component hierarchy. However, for correct operating of such a mixed hierarchy of components, the whole hierarchy must be valid. When the hierarchy gets invalidated, like after changing the bounds of components, or adding/removing components to/from containers, the whole hierarchy must be validated afterwards by means of the Container#validate() method invoked on the top-most invalid container of the hierarchy.

Serialization

It is important to note that only AWT listeners which conform to the Serializable protocol will be saved when the object is stored. If an AWT object has listeners that aren't marked serializable, they will be dropped at writeObject time. Developers will need, as always, to consider the implications of making an object serializable. One situation to watch out for is this:
   import java.awt.*;
   import java.awt.event.*;
   import java.io.Serializable;

   class MyApp implements ActionListener, Serializable
   {
       BigObjectThatShouldNotBeSerializedWithAButton bigOne;
       Button aButton = new Button();

       MyApp()
       {
           // Oops, now aButton has a listener with a reference
           // to bigOne!
           aButton.addActionListener(this);
       }

       public void actionPerformed(ActionEvent e)
       {
           System.out.println("Hello There");
       }
   }
In this example, serializing aButton by itself will cause MyApp and everything it refers to to be serialized as well. The problem is that the listener is serializable by coincidence, not by design. To separate the decisions about MyApp and the ActionListener being serializable one can use a nested class, as in the following example:
   import java.awt.*;
   import java.awt.event.*;
   import java.io.Serializable;

   class MyApp implements java.io.Serializable
   {
        BigObjectThatShouldNotBeSerializedWithAButton bigOne;
        Button aButton = new Button();

        static class MyActionListener implements ActionListener
        {
            public void actionPerformed(ActionEvent e)
            {
                System.out.println("Hello There");
            }
        }

        MyApp()
        {
            aButton.addActionListener(new MyActionListener());
        }
   }

Note

For more information on the paint mechanisms utilized by AWT and Swing, including information on how to write the most efficient painting code, see Painting in AWT and Swing.

For details on the focus subsystem, see How to Use the Focus Subsystem, a section in The Java Tutorial, and the Focus Specification for more information.

Authors
Arthur van Hoff, Sami Shaio

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract class
Component.AccessibleAWTComponent

Inner class of Component used to provide default support for accessibility.

pack-priv static class
public static enum
Component.BaselineResizeBehavior

Enumeration of the common ways the baseline of a component can change as the size changes.

protected class
Component.BltBufferStrategy

Inner class for blitting offscreen surfaces to a component.

private class
Component.BltSubRegionBufferStrategy

Private class to perform sub-region blitting.

private static class
protected class
Component.FlipBufferStrategy

Inner class for flipping buffers on a component.

private class
Component.FlipSubRegionBufferStrategy

Private class to perform sub-region flipping.

private static class
Component.ProxyCapabilities

This is a proxy capabilities class used when a FlipBufferStrategy is created instead of the requested Blit strategy.

private class
Component.SingleBufferStrategy

Inner class for flipping buffers on a component.

Field Summary

Modifier and TypeField and Description
protected AccessibleContext
accessibleContext

The AccessibleContext associated with this Component.

pack-priv static final String
actionListenerK

Internal, constants for serialization

pack-priv static final String
private boolean
pack-priv Color
background

The background color for this component.

pack-priv transient boolean
public static final float
BOTTOM_ALIGNMENT

Ease-of-use constant for getAlignmentY.

private int
private transient BufferStrategy
bufferStrategy

A reference to a BufferStrategy object used to manipulate the buffers on this component.

public static final float
CENTER_ALIGNMENT

Ease-of-use constant for getAlignmentY and getAlignmentX.

private PropertyChangeSupport
changeSupport

If any PropertyChangeListeners have been registered, the changeSupport field describes them.

private static final Class<?>[]
coalesceEventsParams

Parameter types of coalesceEvents(AWTEvent,AWTEVent).

private static final Map<Class<?>, Boolean>
coalesceMap

Weak map of known coalesceEvent overriders.

private transient boolean
pack-priv transient ComponentListener
pack-priv static final String
pack-priv transient ComponentOrientation
componentOrientation

The orientation for this component.

private int
componentSerializedDataVersion

Component Serialized Data Version.

private transient Region
pack-priv static final String
pack-priv Cursor
cursor

The cursor displayed when pointer is over this component.

pack-priv DropTarget
dropTarget

The DropTarget associated with this component.

pack-priv boolean
enabled

True when the object is enabled.

pack-priv transient EventQueueItem[]
private static final PlatformLogger
pack-priv long
eventMask

The eventMask is ONLY set by subclasses via enableEvents.

private static final int
private static final int
private static final int
private boolean
focusable

Indicates whether this Component can be focused.

pack-priv transient FocusListener
pack-priv static final String
private static final PlatformLogger
private static final String[]
pack-priv Set<AWTKeyStroke>[]
focusTraversalKeys

The focus traversal keys.

private boolean
focusTraversalKeysEnabled

Indicates whether focus traversal keys are enabled for this Component.

pack-priv volatile Font
font

The font used by this component.

pack-priv Color
foreground

The foreground color for this component.

private transient volatile GraphicsConfiguration
graphicsConfig

A reference to a GraphicsConfiguration object used to describe the characteristics of a graphics destination.

pack-priv int
height

The height of the component.

pack-priv transient HierarchyBoundsListener
pack-priv static final String
pack-priv transient HierarchyListener
pack-priv static final String
pack-priv boolean
ignoreRepaint

True when the object should ignore all repaint events.

pack-priv static int
pack-priv transient InputMethodListener
pack-priv static final String
private transient boolean
private int
isFocusTraversableOverridden

Tracks whether this Component is relying on default focus traversability.

pack-priv static boolean
isInc

Static properties for incremental drawing.

pack-priv boolean
pack-priv static final String
pack-priv transient KeyListener
pack-priv static final String
public static final float
LEFT_ALIGNMENT

Ease-of-use constant for getAlignmentX.

pack-priv Locale
locale

The locale for the component.

pack-priv static final Object
LOCK

The locking object for AWT component-tree and layout operations.

private static final PlatformLogger
pack-priv Dimension
maxSize

Maximum size

pack-priv boolean
pack-priv Dimension
minSize

Minimum size.

pack-priv boolean
private transient Region
private static final PlatformLogger
pack-priv transient MouseListener
pack-priv static final String
pack-priv transient MouseMotionListener
pack-priv static final String
pack-priv transient MouseWheelListener
pack-priv static final String
private String
name

A component's name.

private boolean
nameExplicitlySet

A bool to determine whether the name has been set explicitly.

pack-priv boolean
newEventsOnly

newEventsOnly will be true if the event is one of the event types enabled for the component.

private transient Object
pack-priv static final String
pack-priv transient Container
parent

The parent of the object.

pack-priv transient volatile ComponentPeer
peer

The peer of the component.

pack-priv Font
pack-priv Vector<PopupMenu>
pack-priv Dimension
prefSize

Preferred size.

pack-priv boolean
private static RequestFocusController
public static final float
RIGHT_ALIGNMENT

Ease-of-use constant for getAlignmentX.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.1 for interoperability.

pack-priv static final String
public static final float
TOP_ALIGNMENT

Ease-of-use constant for getAlignmentY().

private volatile boolean
valid

True when the object is valid.

pack-priv boolean
visible

True when the object is visible.

pack-priv int
width

The width of the component.

pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv int
x

The x position of the component in the parent's coordinate system.

pack-priv int
y

The y position of the component in the parent's coordinate system.

Constructor Summary

AccessConstructor and Description
protected
Component()

Constructs a new component.

Method Summary

Modifier and TypeMethod and Description
public boolean
action(Event
the event to handle
evt
,
Object
the object acted on
what
)
Deprecated As of JDK version 1.1, should register this component as ActionListener on component which fires action events.

Returns: false

public void
add(PopupMenu
the popup menu to be added to the component.
popup
)

Adds the specified popup menu to the component.

public synchronized void
addComponentListener(ComponentListener
the component listener
l
)

Adds the specified component listener to receive component events from this component.

public synchronized void
addFocusListener(FocusListener
the focus listener
l
)

Adds the specified focus listener to receive focus events from this component when this component gains input focus.

public void
addHierarchyBoundsListener(HierarchyBoundsListener
the hierarchy bounds listener
l
)

Adds the specified hierarchy bounds listener to receive hierarchy bounds events from this component when the hierarchy to which this container belongs changes.

public void
addHierarchyListener(HierarchyListener
the hierarchy listener
l
)

Adds the specified hierarchy listener to receive hierarchy changed events from this component when the hierarchy to which this container belongs changes.

public synchronized void
addInputMethodListener(InputMethodListener
the input method listener
l
)

Adds the specified input method listener to receive input method events from this component.

public synchronized void
addKeyListener(KeyListener
the key listener.
l
)

Adds the specified key listener to receive key events from this component.

public synchronized void
addMouseListener(MouseListener
the mouse listener
l
)

Adds the specified mouse listener to receive mouse events from this component.

public synchronized void
addMouseMotionListener(MouseMotionListener
the mouse motion listener
l
)

Adds the specified mouse motion listener to receive mouse motion events from this component.

public synchronized void
addMouseWheelListener(MouseWheelListener
the mouse wheel listener
l
)

Adds the specified mouse wheel listener to receive mouse wheel events from this component.

public void
addNotify()

Makes this Component displayable by connecting it to a native screen resource.

public void
addPropertyChangeListener(PropertyChangeListener
the property change listener to be added
listener
)

Adds a PropertyChangeListener to the listener list.

public void
addPropertyChangeListener(String
one of the property names listed above
propertyName
,
PropertyChangeListener
the property change listener to be added
listener
)

Adds a PropertyChangeListener to the listener list for a specific property.

pack-priv void
adjustListeningChildrenOnParent(long mask, int num)

public void
applyComponentOrientation(ComponentOrientation
the new component orientation of this component and the components contained within it.
orientation
)

Sets the ComponentOrientation property of this component and all components contained within it.

pack-priv void
applyCompoundShape(Region
Shape to be applied to the component
shape
)

Applies the shape to the component

pack-priv void
private void
pack-priv final boolean
areBoundsValid()

Check whether we can trust the current bounds of the component.

public boolean

Returns:

true if the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Component; false otherwise.
areFocusTraversalKeysSet
(int
one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
id
)

Returns whether the Set of focus traversal keys for the given focus traversal operation has been explicitly defined for this Component.

pack-priv boolean
pack-priv void
public Rectangle

Returns:

the bounding rectangle for this component
bounds
()
Deprecated As of JDK version 1.1, replaced by getBounds().

Returns the bounding rectangle of this component.

private Region
pack-priv final boolean
pack-priv final boolean
canBeFocusOwnerRecursively()

Checks that this component meets the prerequisites to be focus owner: - it is enabled, visible, focusable - it's parents are all enabled and showing - top-level window is focusable - if focus cycle root has DefaultFocusTraversalPolicy then it also checks that this policy accepts this component as focus owner

private boolean
checkCoalescing()

Indicates whether this class overrides coalesceEvents.

pack-priv void
checkGD(String stringID)

Checks that this component's GraphicsDevice idString matches the string argument.

public int

Returns:

the bitwise inclusive OR of ImageObserver flags indicating what information about the image is currently available
checkImage
(Image
the Image object whose status is being checked
image
,
ImageObserver
the ImageObserver object to be notified as the image is being prepared
observer
)

Returns the status of the construction of a screen representation of the specified image.

public int

Returns:

the bitwise inclusive OR of ImageObserver flags indicating what information about the image is currently available
checkImage
(Image
the Image object whose status is being checked
image
,
int
the width of the scaled version whose status is to be checked
width
,
int
the height of the scaled version whose status is to be checked
height
,
ImageObserver
the ImageObserver object to be notified as the image is being prepared
observer
)

Returns the status of the construction of a screen representation of the specified image.

pack-priv final void
pack-priv void
pack-priv void
protected AWTEvent

Returns:

a coalesced event, or null indicating that no coalescing was done
coalesceEvents
(AWTEvent
the event already on the EventQueue
existingEvent
,
AWTEvent
the event being posted to the EventQueue
newEvent
)

Potentially coalesce an event being posted with an existing event.

pack-priv String
constructComponentName()

Constructs a name for this component.

public boolean

Returns:

true if the point is within the component; otherwise false
contains
(int
the x coordinate of the point
x
,
int
the y coordinate of the point
y
)

Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.

public boolean

Returns:

true if the point is within the component; otherwise false
contains
(Point
the point
p
)

Checks whether this component "contains" the specified point, where the point's x and y coordinates are defined to be relative to the coordinate system of this component.

pack-priv boolean
pack-priv int
pack-priv void
createBufferStrategy(int
number of buffers to create, including the front buffer
numBuffers
)

Creates a new strategy for multi-buffering on this component.

pack-priv void
createBufferStrategy(int
number of buffers to create
numBuffers
,
BufferCapabilities
the required capabilities for creating the buffer strategy; cannot be null
caps
)

Creates a new strategy for multi-buffering on this component with the required buffer capabilities.

pack-priv int
createHierarchyEvents(int id, Component changed, Container changedParent, long changeFlags, boolean enabledOnToolkit)

public Image

Returns:

the image produced
createImage
(ImageProducer
the image producer
producer
)

Creates an image from the specified image producer.

public Image

Returns:

an off-screen drawable image, which can be used for double buffering. The null value if the component is not displayable or GraphicsEnvironment.isHeadless() returns true.
createImage
(int
the specified width
width
,
int
the specified height
height
)

Creates an off-screen drawable image to be used for double buffering.

public VolatileImage

Returns:

an off-screen drawable image, which can be used for double buffering. The null value if the component is not displayable or GraphicsEnvironment.isHeadless() returns true.
createVolatileImage
(int
the specified width
width
,
int
the specified height
height
)

Creates a volatile off-screen drawable image to be used for double buffering.

public VolatileImage

Returns:

a VolatileImage object, which can be used to manage surface contents loss and capabilities. The null value if the component is not displayable or GraphicsEnvironment.isHeadless() returns true.
createVolatileImage
(int
the specified width
width
,
int
the specified height
height
,
ImageCapabilities
the image capabilities
caps
)

Creates a volatile off-screen drawable image, with the given capabilities.

public void
deliverEvent(Event
the event to deliver
e
)
Deprecated As of JDK version 1.1, replaced by dispatchEvent(AWTEvent e).

public void
disable()
Deprecated As of JDK version 1.1, replaced by setEnabled(boolean).

protected final void
disableEvents(long
the event mask defining the event types
eventsToDisable
)

Disables the events defined by the specified event mask parameter from being delivered to this component.

public final void
dispatchEvent(AWTEvent
the event
e
)

Dispatches an event to this component or one of its sub components.

pack-priv void
pack-priv boolean
public void
doLayout()

Prompts the layout manager to lay out this component.

private void
doSwingSerialization()

This hack is for Swing serialization.

public void
enable()
Deprecated As of JDK version 1.1, replaced by setEnabled(boolean).

public void
enable(boolean
true to enable this component; otherwise false
b
)
Deprecated As of JDK version 1.1, replaced by setEnabled(boolean).

Enables or disables this component.

protected final void
enableEvents(long
the event mask defining the event types
eventsToEnable
)

Enables the events defined by the specified event mask parameter to be delivered to this component.

public void
enableInputMethods(boolean
true to enable, false to disable
enable
)

Enables or disables input method support for this component.

pack-priv boolean
pack-priv boolean
eventTypeEnabled(int type)

pack-priv Component
findUnderMouseInWindow(PointerInfo pi)

Assuming that mouse location is stored in PointerInfo passed to this method, it finds a Component that is in the same Window as this Component and is located under the mouse pointer.

protected void
firePropertyChange(String
the property whose value has changed
propertyName
,
Object
the property's previous value
oldValue
,
Object
the property's new value
newValue
)

Support for reporting bound property changes for Object properties.

protected void
firePropertyChange(String
the property whose value has changed
propertyName
,
boolean
the property's previous value
oldValue
,
boolean
the property's new value
newValue
)

Support for reporting bound property changes for boolean properties.

protected void
firePropertyChange(String
the property whose value has changed
propertyName
,
int
the property's previous value
oldValue
,
int
the property's new value
newValue
)

Support for reporting bound property changes for integer properties.

public void
firePropertyChange(String
the programmatic name of the property that was changed
propertyName
,
byte
the old value of the property (as a byte)
oldValue
,
byte
the new value of the property (as a byte)
newValue
)

Reports a bound property change.

public void
firePropertyChange(String
the programmatic name of the property that was changed
propertyName
,
char
the old value of the property (as a char)
oldValue
,
char
the new value of the property (as a char)
newValue
)

Reports a bound property change.

public void
firePropertyChange(String
the programmatic name of the property that was changed
propertyName
,
short
the old value of the property (as a short)
oldValue
,
short
the new value of the property (as a short)
newValue
)

Reports a bound property change.

public void
firePropertyChange(String
the programmatic name of the property that was changed
propertyName
,
long
the old value of the property (as a long)
oldValue
,
long
the new value of the property (as a long)
newValue
)

Reports a bound property change.

public void
firePropertyChange(String
the programmatic name of the property that was changed
propertyName
,
float
the old value of the property (as a float)
oldValue
,
float
the new value of the property (as a float)
newValue
)

Reports a bound property change.

public void
firePropertyChange(String
the programmatic name of the property that was changed
propertyName
,
double
the old value of the property (as a double)
oldValue
,
double
the new value of the property (as a double)
newValue
)

Reports a bound property change.

public AccessibleContext

Returns:

the AccessibleContext of this Component
getAccessibleContext
()

Gets the AccessibleContext associated with this Component.

pack-priv int

Returns:

the index of this object in its accessible parent
getAccessibleIndexInParent
()

Gets the index of this object in its accessible parent.

pack-priv AccessibleStateSet

Returns:

an instance of AccessibleStateSet containing the current state set of the object
getAccessibleStateSet
()

Gets the current state set of this object.

public float

Returns:

the horizontal alignment of this component
getAlignmentX
()

Returns the alignment along the x axis.

public float

Returns:

the vertical alignment of this component
getAlignmentY
()

Returns the alignment along the y axis.

private Region
getAppliedShape()

Returns the shape previously set with applyCompoundShape().

pack-priv Image
getBackBuffer()

Returns: the back buffer currently used by this component's BufferStrategy.

public Color

Returns:

this component's background color; if this component does not have a background color, the background color of its parent is returned
getBackground
()

Gets the background color of this component.

public int

Returns:

the baseline or < 0 indicating there is no reasonable baseline
getBaseline
(int
the width to get the baseline for
width
,
int
the height to get the baseline for
height
)

Returns the baseline.

public Component.BaselineResizeBehavior

Returns:

an enum indicating how the baseline changes as the component size changes
getBaselineResizeBehavior
()

Returns an enum indicating how the baseline of the component changes as the size changes.

public Rectangle

Returns:

a rectangle indicating this component's bounds
getBounds
()

Gets the bounds of this component in the form of a Rectangle object.

public Rectangle

Returns:

rv
getBounds
(Rectangle
the return value, modified to the components bounds
rv
)

Stores the bounds of this component into "return value" rv and return rv.

pack-priv int
getBoundsOp()

Should only be used in subclass getBounds to check that part of bounds is actually changing

pack-priv BufferStrategy
getBufferStrategy()

Returns: the buffer strategy used by this component

public ColorModel

Returns:

the color model used by this component
getColorModel
()

Gets the instance of ColorModel used to display the component on the output device.

public Component

Returns:

the component or subcomponent that contains the (x, y) location; null if the location is outside this component
getComponentAt
(int
the x coordinate
x
,
int
the y coordinate
y
)

Determines if this component or one of its immediate subcomponents contains the (x, y) location, and if so, returns the containing component.

public Component

Returns:

the component at the specified location or null
getComponentAt
(Point
the point
p
)

Returns the component or subcomponent that contains the specified point.

pack-priv final ComponentFactory
public synchronized ComponentListener[]

Returns:

all ComponentListeners of this component or an empty array if no component listeners are currently registered
getComponentListeners
()

Returns an array of all the component listeners registered on this component.

public ComponentOrientation

Returns:

the orientation to order the elements or text
getComponentOrientation
()

Retrieves the language-sensitive orientation that is to be used to order the elements or text within this component.

pack-priv Container
pack-priv Window

Returns:

Window ancestor of the component or component by itself if it is Window; null, if component is not a part of window hierarchy
getContainingWindow
()

Returns the Window ancestor of the component.

public Cursor

Returns:

the cursor for this component
getCursor
()

Gets the cursor set in the component.

pack-priv final Cursor
public synchronized DropTarget

Returns:

the drop target
getDropTarget
()

Gets the DropTarget associated with this Component.

public Container

Returns:

this Component's nearest focus-cycle-root ancestor
getFocusCycleRootAncestor
()

Returns the Container which is the focus cycle root of this Component's focus traversal cycle.

public synchronized FocusListener[]

Returns:

all of this component's FocusListeners or an empty array if no component listeners are currently registered
getFocusListeners
()

Returns an array of all the focus listeners registered on this component.

public Set<AWTKeyStroke>

Returns:

the Set of AWTKeyStrokes for the specified operation. The Set will be unmodifiable, and may be empty. null will never be returned.
getFocusTraversalKeys
(int
one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
id
)

Returns the Set of focus traversal keys for a given traversal operation for this Component.

pack-priv final Set<AWTKeyStroke>
public boolean

Returns:

whether focus traversal keys are enabled for this Component
getFocusTraversalKeysEnabled
()

Returns whether focus traversal keys are enabled for this Component.

public Font

Returns:

this component's font; if a font has not been set for this component, the font of its parent is returned
getFont
()

Implements java.awt.MenuContainer.getFont.

Gets the font of this component.

pack-priv final Font
public FontMetrics

Returns:

the font metrics for font
getFontMetrics
(Font
the font for which font metrics is to be obtained
font
)

Gets the font metrics for the specified font.

public Color

Returns:

this component's foreground color; if this component does not have a foreground color, the foreground color of its parent is returned
getForeground
()

Gets the foreground color of this component.

public Graphics

Returns:

a graphics context for this component, or null if it has none
getGraphics
()

Creates a graphics context for this component.

pack-priv final Graphics
public GraphicsConfiguration

Returns:

the GraphicsConfiguration used by this Component or null
getGraphicsConfiguration
()

Gets the GraphicsConfiguration associated with this Component.

pack-priv final GraphicsConfiguration
public int

Returns:

the current height of this component
getHeight
()

Returns the current height of this component.

public synchronized HierarchyBoundsListener[]

Returns:

all of this component's HierarchyBoundsListeners or an empty array if no hierarchy bounds listeners are currently registered
getHierarchyBoundsListeners
()

Returns an array of all the hierarchy bounds listeners registered on this component.

public synchronized HierarchyListener[]

Returns:

all of this component's HierarchyListeners or an empty array if no hierarchy listeners are currently registered
getHierarchyListeners
()

Returns an array of all the hierarchy listeners registered on this component.

pack-priv final ComponentPeer
public boolean

Returns:

whether or not paint messages received from the operating system should be ignored
getIgnoreRepaint
()

Returns whether or not paint messages received from the operating system should be ignored.

public InputContext

Returns:

the input context used by this component; null if no context can be determined
getInputContext
()

Gets the input context used by this component for handling the communication with input methods when text is entered in this component.

public synchronized InputMethodListener[]

Returns:

all of this component's InputMethodListeners or an empty array if no input method listeners are currently registered
getInputMethodListeners
()

Returns an array of all the input method listeners registered on this component.

public InputMethodRequests

Returns:

the input method request handler for this component, null by default
getInputMethodRequests
()

Gets the input method request handler which supports requests from input methods for this component.

private Insets
public synchronized KeyListener[]

Returns:

all of this component's KeyListeners or an empty array if no key listeners are currently registered
getKeyListeners
()

Returns an array of all the key listeners registered on this component.

public <
the type of the listeners
T extends EventListener
>
T[]

Returns:

an array of all objects registered as FooListeners on this component, or an empty array if no such listeners have been added
getListeners
(Class<T>
the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
listenerType
)

Returns an array of all the objects currently registered as FooListeners upon this Component.

public Locale

Returns:

this component's locale; if this component does not have a locale, the locale of its parent is returned
getLocale
()

Gets the locale of this component.

public Point

Returns:

an instance of Point representing the top-left corner of the component's bounds in the coordinate space of the component's parent
getLocation
()

Gets the location of this component in the form of a point specifying the component's top-left corner.

public Point

Returns:

rv
getLocation
(Point
the return value, modified to the components location
rv
)

Stores the x,y origin of this component into "return value" rv and return rv.

public Point

Returns:

an instance of Point representing the top-left corner of the component's bounds in the coordinate space of the screen
getLocationOnScreen
()

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.

pack-priv final Point
pack-priv Point
public Dimension

Returns:

a dimension object indicating this component's maximum size
getMaximumSize
()

Gets the maximum size of this component.

public Dimension

Returns:

a dimension object indicating this component's minimum size
getMinimumSize
()

Gets the minimum size of this component.

public synchronized MouseListener[]

Returns:

all of this component's MouseListeners or an empty array if no mouse listeners are currently registered
getMouseListeners
()

Returns an array of all the mouse listeners registered on this component.

public synchronized MouseMotionListener[]

Returns:

all of this component's MouseMotionListeners or an empty array if no mouse motion listeners are currently registered
getMouseMotionListeners
()

Returns an array of all the mouse motion listeners registered on this component.

public Point

Returns:

mouse coordinates relative to this Component, or null
getMousePosition
()

Returns the position of the mouse pointer in this Component's coordinate space if the Component is directly under the mouse pointer, otherwise returns null.

public synchronized MouseWheelListener[]

Returns:

all of this component's MouseWheelListeners or an empty array if no mouse wheel listeners are currently registered
getMouseWheelListeners
()

Returns an array of all the mouse wheel listeners registered on this component.

public String

Returns:

this component's name
getName
()

Gets the name of the component.

pack-priv final Container
pack-priv final Component
pack-priv final Region
getNormalShape()

Returns the full shape of the component located in window coordinates

pack-priv Object
pack-priv Region
getOpaqueShape()

Returns the "opaque shape" of the component.

public Container

Returns:

the parent container of this component
getParent
()

Gets the parent of this component.

pack-priv final Container
public Dimension

Returns:

a dimension object indicating this component's preferred size
getPreferredSize
()

Gets the preferred size of this component.

public PropertyChangeListener[]

Returns:

all of this component's PropertyChangeListeners or an empty array if no property change listeners are currently registered
getPropertyChangeListeners
()

Returns an array of all the property change listeners registered on this component.

public PropertyChangeListener[]

Returns:

all of the PropertyChangeListeners associated with the named property; if no such listeners have been added or if propertyName is null, an empty array is returned
getPropertyChangeListeners
(String
the property name
propertyName
)

Returns an array of all the listeners which have been associated with the named property.

private Rectangle

Returns:

the visible part of bounds
getRecursivelyVisibleBounds
()

Determines the bounds of a visible part of the component relative to its parent.

pack-priv final int
pack-priv final int
public Dimension

Returns:

a Dimension object that indicates the size of this component
getSize
()

Returns the size of this component in the form of a Dimension object.

public Dimension

Returns:

rv
getSize
(Dimension
the return value, modified to the components size
rv
)

Stores the width/height of this component into "return value" rv and return rv.

public Toolkit

Returns:

the toolkit of this component
getToolkit
()

Gets the toolkit of this component.

pack-priv final Toolkit
pack-priv Container
public final Object

Returns:

this component's locking object
getTreeLock
()

Gets this component's locking object (the object that owns the thread synchronization monitor) for AWT component-tree and layout operations.

public int

Returns:

the current width of this component
getWidth
()

Returns the current width of this component.

public int

Returns:

the current x coordinate of the components origin
getX
()

Returns the current x coordinate of the components origin.

public int

Returns:

the current y coordinate of the components origin
getY
()

Returns the current y coordinate of the components origin.

public boolean
gotFocus(Event
the event to handle
evt
,
Object
the object focused
what
)
Deprecated As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).

Returns: false

public boolean
handleEvent(Event
the event to handle
evt
)
Deprecated As of JDK version 1.1 replaced by processEvent(AWTEvent).

Returns: true if the event was handled, false otherwise

public boolean

Returns:

true if this Component is the focus owner; false otherwise
hasFocus
()

Returns true if this Component is the focus owner.

public void
hide()
Deprecated As of JDK version 1.1, replaced by setVisible(boolean).

public boolean

Returns:

false if the infoflags indicate that the image is completely loaded; true otherwise.
imageUpdate
(Image
the image being observed
img
,
int
see imageUpdate for more information
infoflags
,
int
the x coordinate
x
,
int
the y coordinate
y
,
int
the width
w
,
int
the height
h
)

Implements java.awt.image.ImageObserver.imageUpdate.

Repaints the component when the image has changed.

pack-priv void
private static native void
initIDs()

Initialize JNI field and method IDs

public boolean

Returns:

true if the point is within the component; otherwise false
inside
(int
the x coordinate of the point
x
,
int
the y coordinate of the point
y
)
Deprecated As of JDK version 1.1, replaced by contains(int, int).

Checks whether the point is inside of this component.

public void
invalidate()

Invalidates this component and its ancestors.

pack-priv final void
invalidateIfValid()

Invalidates the component unless it is already invalid.

pack-priv void
invalidateParent()

Invalidates the parent of this component if any.

pack-priv boolean
public boolean

Returns:

true if the background color has been explicitly set for this Component; false otherwise.
isBackgroundSet
()

Returns whether the background color has been explicitly set for this Component.

private static boolean
isCoalesceEventsOverriden(Class<?> clazz)

Indicates whether a class or its superclasses override coalesceEvents.

pack-priv final boolean
isCoalescingEnabled()

Indicates whether coalesceEvents may do something.

public boolean

Returns:

true if the cursor has been explicitly set for this Component; false otherwise.
isCursorSet
()

Returns whether the cursor has been explicitly set for this Component.

public boolean

Returns:

true if the component is displayable, false otherwise
isDisplayable
()

Determines whether this component is displayable.

public boolean

Returns:

false by default
isDoubleBuffered
()

Returns true if this component is painted to an offscreen image ("buffer") that's copied to the screen later.

public boolean

Returns:

true if the component is enabled, false otherwise
isEnabled
()

Determines whether this component is enabled.

pack-priv final boolean
public boolean

Returns:

true if this Component is focusable; false otherwise.
isFocusable
()

Returns whether this Component can be focused.

public boolean

Returns:

true if the specified Container is a focus-cycle- root of this Component; false otherwise
isFocusCycleRoot
(Container
the Container to be tested
container
)

Returns whether the specified Container is the focus cycle root of this Component's focus traversal cycle.

public boolean

Returns:

true if this Component is the focus owner; false otherwise
isFocusOwner
()

Returns true if this Component is the focus owner.

public boolean

Returns:

true if this Component is focusable; false otherwise
isFocusTraversable
()
Deprecated As of 1.4, replaced by isFocusable().

Returns whether this Component can become the focus owner.

pack-priv final boolean
public boolean

Returns:

true if the font has been explicitly set for this Component; false otherwise.
isFontSet
()

Returns whether the font has been explicitly set for this Component.

public boolean

Returns:

true if the foreground color has been explicitly set for this Component; false otherwise.
isForegroundSet
()

Returns whether the foreground color has been explicitly set for this Component.

pack-priv static boolean

Returns:

true, if this object is instanceof given class, false, otherwise, or if obj or className is null
isInstanceOf
(Object
Object to be checked
obj
,
String
The name of the class. Must be fully-qualified class name.
className
)

Checks that the given object is instance of the given class.

public boolean

Returns:

true if this component has a lightweight peer; false if it has a native peer or no peer
isLightweight
()

A lightweight component doesn't have a native toolkit peer.

public boolean

Returns:

true if maximumSize is non-null, false otherwise
isMaximumSizeSet
()

Returns true if the maximum size has been set to a non-null value otherwise returns false.

public boolean

Returns:

true if setMinimumSize has been invoked with a non-null value.
isMinimumSizeSet
()

Returns whether or not setMinimumSize has been invoked with a non-null value.

pack-priv final boolean
pack-priv final boolean
public boolean

Returns:

true if this component is completely opaque
isOpaque
()

Returns true if this component is completely opaque, returns false by default.

public boolean

Returns:

true if setPreferredSize has been invoked with a non-null value.
isPreferredSizeSet
()

Returns true if the preferred size has been set to a non-null value otherwise returns false.

pack-priv boolean

Returns:

true if the component and all of its ancestors until a toplevel window or null parent are visible, false otherwise
isRecursivelyVisible
()

Determines whether this component will be displayed on the screen.

private boolean
isRequestFocusAccepted(boolean temporary, boolean focusedWindowChangeAllowed, FocusEvent.Cause cause)

pack-priv boolean
isSameOrAncestorOf(Component comp, boolean allowChildren)

Overridden in Container.

public boolean

Returns:

true if the component is showing, false otherwise
isShowing
()

Determines whether this component is showing on screen.

public boolean

Returns:

true if the component is valid, false otherwise
isValid
()

Determines whether this component is valid.

public boolean

Returns:

true if the component is visible, false otherwise
isVisible
()

Determines whether this component should be visible when its parent is visible.

pack-priv final boolean
public boolean
keyDown(Event
the event to handle
evt
,
int
the key pressed
key
)
Deprecated As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).

Returns: false

public boolean
keyUp(Event
the event to handle
evt
,
int
the key pressed
key
)
Deprecated As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).

Returns: false

public void
layout()
Deprecated As of JDK version 1.1, replaced by doLayout().

pack-priv void
lightweightPaint(Graphics
the graphics context to use for painting
g
)

Simulates the peer callbacks into java.awt for painting of lightweight Components.

pack-priv void
lightweightPrint(Graphics
the graphics context to use for printing
g
)

Simulates the peer callbacks into java.awt for printing of lightweight Components.

public void
list()

Prints a listing of this component to the standard system output stream System.out.

public void
list(PrintStream
a print stream
out
)

Prints a listing of this component to the specified output stream.

public void
list(PrintStream
a print stream
out
,
int
number of spaces to indent
indent
)

Prints out a list, starting at the specified indentation, to the specified print stream.

public void
list(PrintWriter
the print writer to print to
out
)

Prints a listing to the specified print writer.

public void
list(PrintWriter
the print writer to print to
out
,
int
the number of spaces to indent
indent
)

Prints out a list, starting at the specified indentation, to the specified print writer.

public Component

Returns:

the component at the specified location or null
locate
(int
the x coordinate to search for components at
x
,
int
the y coordinate to search for components at
y
)
Deprecated As of JDK version 1.1, replaced by getComponentAt(int, int).

Returns the component occupying the position specified (this component, or immediate child component, or null if neither of the first two occupies the location).

public Point

Returns:

the location of this component's top left corner
location
()
Deprecated As of JDK version 1.1, replaced by getLocation().

Returns the location of this component's top left corner.

private Point
public boolean
lostFocus(Event
the event to handle
evt
,
Object
the object focused
what
)
Deprecated As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).

Returns: false

public Dimension

Returns:

the minimum size of this component
minimumSize
()
Deprecated As of JDK version 1.1, replaced by getMinimumSize().

Returns the minimum size of this component.

pack-priv void
mixOnHiding(boolean isLightweight)

pack-priv void
pack-priv void
pack-priv void
pack-priv void
mixOnZOrderChanging(int oldZorder, int newZorder)

public boolean
mouseDown(Event
the event to handle
evt
,
int
the x coordinate
x
,
int
the y coordinate
y
)
Deprecated As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

Returns: false

public boolean
mouseDrag(Event
the event to handle
evt
,
int
the x coordinate
x
,
int
the y coordinate
y
)
Deprecated As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).

Returns: false

public boolean
mouseEnter(Event
the event to handle
evt
,
int
the x coordinate
x
,
int
the y coordinate
y
)
Deprecated As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

Returns: false

public boolean
mouseExit(Event
the event to handle
evt
,
int
the x coordinate
x
,
int
the y coordinate
y
)
Deprecated As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

Returns: false

public boolean
mouseMove(Event
the event to handle
evt
,
int
the x coordinate
x
,
int
the y coordinate
y
)
Deprecated As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).

Returns: false

public boolean
mouseUp(Event
the event to handle
evt
,
int
the x coordinate
x
,
int
the y coordinate
y
)
Deprecated As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

Returns: false

public void
move(int
the x-coordinate of the new location's top-left corner in the parent's coordinate space
x
,
int
the y-coordinate of the new location's top-left corner in the parent's coordinate space
y
)
Deprecated As of JDK version 1.1, replaced by setLocation(int, int).

Moves this component to a new location.

public void
nextFocus()
Deprecated As of JDK version 1.1, replaced by transferFocus().

private void
notifyNewBounds(boolean resized, boolean moved)

pack-priv int
numListening(long mask)

public void
paint(Graphics
the graphics context to use for painting
g
)

Paints this component.

public void
paintAll(Graphics
the graphics context to use for painting
g
)

Paints this component and all of its subcomponents.

pack-priv void
paintHeavyweightComponents(Graphics g)

Paints all the heavyweight subcomponents.

protected String

Returns:

a string representation of this component's state
paramString
()

Returns a string representing the state of this component.

pack-priv Point
pointRelativeToComponent(Point absolute)

Translates absolute coordinates into coordinates in the coordinate space of this component.

public boolean
postEvent(Event e)

Implements java.awt.MenuContainer.postEvent.

Deprecated As of JDK version 1.1, replaced by dispatchEvent(AWTEvent).

Posts an event to the listeners.

pack-priv boolean
public Dimension

Returns:

the component's preferred size
preferredSize
()
Deprecated As of JDK version 1.1, replaced by getPreferredSize().

Returns the component's preferred size.

public boolean

Returns:

true if the image has already been fully prepared; false otherwise
prepareImage
(Image
the Image for which to prepare a screen representation
image
,
ImageObserver
the ImageObserver object to be notified as the image is being prepared
observer
)

Prepares an image for rendering on this component.

public boolean

Returns:

true if the image has already been fully prepared; false otherwise
prepareImage
(Image
the instance of Image for which to prepare a screen representation
image
,
int
the width of the desired screen representation
width
,
int
the height of the desired screen representation
height
,
ImageObserver
the ImageObserver object to be notified as the image is being prepared
observer
)

Prepares an image for rendering on this component at the specified width and height.

public void
printAll(Graphics
the graphics context to use for printing
g
)

Prints this component and all of its subcomponents.

pack-priv void
printHeavyweightComponents(Graphics g)

Prints all the heavyweight subcomponents.

protected void
processComponentEvent(ComponentEvent
the component event
e
)

Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.

protected void
processEvent(AWTEvent
the event
e
)

Processes events occurring on this component.

protected void
processFocusEvent(FocusEvent
the focus event
e
)

Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.

protected void
processHierarchyBoundsEvent(HierarchyEvent
the hierarchy event
e
)

Processes hierarchy bounds events occurring on this component by dispatching them to any registered HierarchyBoundsListener objects.

protected void
processHierarchyEvent(HierarchyEvent
the hierarchy event
e
)

Processes hierarchy events occurring on this component by dispatching them to any registered HierarchyListener objects.

protected void
processInputMethodEvent(InputMethodEvent
the input method event
e
)

Processes input method events occurring on this component by dispatching them to any registered InputMethodListener objects.

protected void
processKeyEvent(KeyEvent
the key event
e
)

Processes key events occurring on this component by dispatching them to any registered KeyListener objects.

protected void
processMouseEvent(MouseEvent
the mouse event
e
)

Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

protected void
processMouseMotionEvent(MouseEvent
the mouse motion event
e
)

Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.

protected void
processMouseWheelEvent(MouseWheelEvent
the mouse wheel event
e
)

Processes mouse wheel events occurring on this component by dispatching them to any registered MouseWheelListener objects.

private void
readObject(ObjectInputStream
the ObjectInputStream to read
s
)

Reads the ObjectInputStream and if it isn't null adds a listener to receive a variety of events fired by the component.

pack-priv final void
relocateComponent()

Fix the location of the HW component in a LW container hierarchy.

public void
remove(MenuComponent
the popup menu to be removed
popup
)

Implements java.awt.MenuContainer.remove.

Removes the specified popup menu from the component.

public synchronized void
removeComponentListener(ComponentListener
the component listener
l
)

Removes the specified component listener so that it no longer receives component events from this component.

public synchronized void
removeFocusListener(FocusListener
the focus listener
l
)

Removes the specified focus listener so that it no longer receives focus events from this component.

public void
removeHierarchyBoundsListener(HierarchyBoundsListener
the hierarchy bounds listener
l
)

Removes the specified hierarchy bounds listener so that it no longer receives hierarchy bounds events from this component.

public void
removeHierarchyListener(HierarchyListener
the hierarchy listener
l
)

Removes the specified hierarchy listener so that it no longer receives hierarchy changed events from this component.

public synchronized void
removeInputMethodListener(InputMethodListener
the input method listener
l
)

Removes the specified input method listener so that it no longer receives input method events from this component.

public synchronized void
removeKeyListener(KeyListener
the key listener
l
)

Removes the specified key listener so that it no longer receives key events from this component.

public synchronized void
removeMouseListener(MouseListener
the mouse listener
l
)

Removes the specified mouse listener so that it no longer receives mouse events from this component.

public synchronized void
removeMouseMotionListener(MouseMotionListener
the mouse motion listener
l
)

Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component.

public synchronized void
removeMouseWheelListener(MouseWheelListener
the mouse wheel listener.
l
)

Removes the specified mouse wheel listener so that it no longer receives mouse wheel events from this component.

public void
removeNotify()

Makes this Component undisplayable by destroying it native screen resource.

public void
removePropertyChangeListener(PropertyChangeListener
the PropertyChangeListener to be removed
listener
)

Removes a PropertyChangeListener from the listener list.

public void
removePropertyChangeListener(String
a valid property name
propertyName
,
PropertyChangeListener
the PropertyChangeListener to be removed
listener
)

Removes a PropertyChangeListener from the listener list for a specific property.

public void
repaint()

Repaints this component.

public void
repaint(long
maximum time in milliseconds before update
tm
)

Repaints the component.

public void
repaint(int
the x coordinate
x
,
int
the y coordinate
y
,
int
the width
width
,
int
the height
height
)

Repaints the specified rectangle of this component.

public void
repaint(long
maximum time in milliseconds before update
tm
,
int
the x coordinate
x
,
int
the y coordinate
y
,
int
the width
width
,
int
the height
height
)

Repaints the specified rectangle of this component within tm milliseconds.

private void
repaintParentIfNeeded(int oldX, int oldY, int oldWidth, int oldHeight)

public void
requestFocus()

Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.

public void
requestFocus(FocusEvent.Cause
the cause why the focus is requested
cause
)

Requests by the reason of cause that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.

protected boolean

Returns:

false if the focus change request is guaranteed to fail; true if it is likely to succeed
requestFocus
(boolean
true if the focus change is temporary, such as when the window loses the focus; for more information on temporary focus changes see the Focus Specification
temporary
)

Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.

protected boolean

Returns:

false if the focus change request is guaranteed to fail; true if it is likely to succeed
requestFocus
(boolean
true if the focus change is temporary, such as when the window loses the focus; for more information on temporary focus changes see the Focus Specification
temporary
,
FocusEvent.Cause
the cause why the focus is requested
cause
)

Requests by the reason of cause that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.

pack-priv final boolean
requestFocusHelper(boolean temporary, boolean focusedWindowChangeAllowed)

pack-priv final boolean
requestFocusHelper(boolean temporary, boolean focusedWindowChangeAllowed, FocusEvent.Cause cause)

public boolean

Returns:

false if the focus change request is guaranteed to fail; true if it is likely to succeed
requestFocusInWindow
()

Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.

public boolean

Returns:

false if the focus change request is guaranteed to fail; true if it is likely to succeed
requestFocusInWindow
(FocusEvent.Cause
the cause why the focus is requested
cause
)

Requests by the reason of cause that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.

protected boolean

Returns:

false if the focus change request is guaranteed to fail; true if it is likely to succeed
requestFocusInWindow
(boolean
true if the focus change is temporary, such as when the window loses the focus; for more information on temporary focus changes see the Focus Specification
temporary
)

Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.

pack-priv boolean
requestFocusInWindow(boolean temporary, FocusEvent.Cause cause)

public void
reshape(int
the x coordinate of the upper left corner of the rectangle
x
,
int
the y coordinate of the upper left corner of the rectangle
y
,
int
the width of the rectangle
width
,
int
the height of the rectangle
height
)
Deprecated As of JDK version 1.1, replaced by setBounds(int, int, int, int).

Reshapes the bounding rectangle for this component.

private void
reshapeNativePeer(int x, int y, int width, int height, int op)

public void
resize(int
the new width of the component
width
,
int
the new height of the component
height
)
Deprecated As of JDK version 1.1, replaced by setSize(int, int).

Resizes this component.

public void
resize(Dimension
the new size of this component
d
)
Deprecated As of JDK version 1.1, replaced by setSize(Dimension).

Resizes this component so that it has width d.width and height d.height.

public void
revalidate()

Revalidates the component hierarchy up to the nearest validate root.

pack-priv final void
revalidateSynchronously()

Revalidates the component synchronously.

pack-priv void
public void
setBackground(Color
the color to become this component's color; if this parameter is null, then this component will inherit the background color of its parent
c
)

Sets the background color of this component.

public void
setBounds(int
the new x-coordinate of this component
x
,
int
the new y-coordinate of this component
y
,
int
the new width of this component
width
,
int
the new height of this component
height
)

Moves and resizes this component.

public void
setBounds(Rectangle
the new bounding rectangle for this component
r
)

Moves and resizes this component to conform to the new bounding rectangle r.

pack-priv void
setBoundsOp(int op)

public void
setComponentOrientation(ComponentOrientation
the orientation to be set
o
)

Sets the language-sensitive orientation that is to be used to order the elements or text within this component.

public void
setCursor(Cursor
One of the constants defined by the Cursor class; if this parameter is null then this component will inherit the cursor of its parent
cursor
)

Sets the cursor image to the specified cursor.

public synchronized void
setDropTarget(DropTarget
The DropTarget
dt
)

Associate a DropTarget with this component.

public void
setEnabled(boolean
If true, this component is enabled; otherwise this component is disabled
b
)

Enables or disables this component, depending on the value of the parameter b.

public void
setFocusable(boolean
indicates whether this Component is focusable
focusable
)

Sets the focusable state of this Component to the specified value.

public void
setFocusTraversalKeys(int
one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
id
,
Set<? extends AWTKeyStroke>
the Set of AWTKeyStroke for the specified operation
keystrokes
)

Sets the focus traversal keys for a given traversal operation for this Component.

pack-priv final void
setFocusTraversalKeys_NoIDCheck(int id, Set<? extends AWTKeyStroke> keystrokes)

public void
setFocusTraversalKeysEnabled(boolean
whether focus traversal keys are enabled for this Component
focusTraversalKeysEnabled
)

Sets whether focus traversal keys are enabled for this Component.

public void
setFont(Font
the font to become this component's font; if this parameter is null then this component will inherit the font of its parent
f
)

Sets the font of this component.

public void
setForeground(Color
the color to become this component's foreground color; if this parameter is null then this component will inherit the foreground color of its parent
c
)

Sets the foreground color of this component.

pack-priv void
public void
setIgnoreRepaint(boolean
true if the paint messages from the OS should be ignored; otherwise false
ignoreRepaint
)

Sets whether or not paint messages received from the operating system should be ignored.

public void
setLocale(Locale
the locale to become this component's locale
l
)

Sets the locale of this component.

public void
setLocation(int
the x-coordinate of the new location's top-left corner in the parent's coordinate space
x
,
int
the y-coordinate of the new location's top-left corner in the parent's coordinate space
y
)

Moves this component to a new location.

public void
setLocation(Point
the point defining the top-left corner of the new location, given in the coordinate space of this component's parent
p
)

Moves this component to a new location.

public void
setMaximumSize(Dimension
a Dimension containing the desired maximum allowable size
maximumSize
)

Sets the maximum size of this component to a constant value.

public void
setMinimumSize(Dimension
the new minimum size of this component
minimumSize
)

Sets the minimum size of this component to a constant value.

public void
setMixingCutoutShape(Shape
the new 'mixing-cutout' shape
shape
)

Sets a 'mixing-cutout' shape for this lightweight component.

public void
setName(String
the string that is to be this component's name
name
)

Sets the name of the component to the specified string.

public void
setPreferredSize(Dimension
The new preferred size, or null
preferredSize
)

Sets the preferred size of this component to a constant value.

pack-priv static synchronized void
public void
setSize(int
the new width of this component in pixels
width
,
int
the new height of this component in pixels
height
)

Resizes this component so that it has width width and height height.

public void
setSize(Dimension
the dimension specifying the new size of this component
d
)

Resizes this component so that it has width d.width and height d.height.

public void
setVisible(boolean
if true, shows this component; otherwise, hides this component
b
)

Shows or hides this component depending on the value of parameter b.

public void
show()
Deprecated As of JDK version 1.1, replaced by setVisible(boolean).

public void
show(boolean
true to make this component visible; otherwise false
b
)
Deprecated As of JDK version 1.1, replaced by setVisible(boolean).

Makes this component visible or invisible.

public Dimension

Returns:

the Dimension object that indicates the size of this component
size
()
Deprecated As of JDK version 1.1, replaced by getSize().

Returns the size of this component in the form of a Dimension object.

pack-priv final void
pack-priv final void
public String

Returns:

a string representation of this component
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this component and its values.

public void
transferFocus()

Transfers the focus to the next component, as though this Component were the focus owner.

pack-priv boolean
transferFocus(boolean clearOnFailure)

public void
transferFocusBackward()

Transfers the focus to the previous component, as though this Component were the focus owner.

pack-priv boolean
transferFocusBackward(boolean clearOnFailure)

public void
transferFocusUpCycle()

Transfers the focus up one focus traversal cycle.

public void
update(Graphics
the specified context to use for updating
g
)

Updates this component.

pack-priv boolean
pack-priv final void
updateCursorImmediately()

Updates the cursor.

pack-priv final boolean
private boolean
pack-priv void
public void
validate()

Validates this component.

private void
writeObject(ObjectOutputStream
the ObjectOutputStream to write
s
)

Writes default serializable fields to stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait