All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Component

java.lang.Object
   |
   +----java.awt.Component

public class Component
extends Object
implements ImageObserver, MenuContainer, Serializable
A generic Abstract Window Toolkit component.


Variable Index

 o BOTTOM_ALIGNMENT
Ease of use constant for getAlignmentY().
 o CENTER_ALIGNMENT
Ease of use constant for getAlignmentY() and getAlignmentX().
 o LEFT_ALIGNMENT
Ease of use constant for getAlignmentX().
 o locale
The locale for the component.
 o RIGHT_ALIGNMENT
Ease of use constant for getAlignmentX().
 o TOP_ALIGNMENT
Ease of use constant for getAlignmentY().

Constructor Index

 o Component()
Constructs a new Component.

Method Index

 o action(Event, Object)
Deprecated.
 o add(PopupMenu)
Adds the specified popup menu to the component.
 o addComponentListener(ComponentListener)
Adds the specified component listener to receive component events from this component.
 o addFocusListener(FocusListener)
Adds the specified focus listener to receive focus events from this component.
 o addKeyListener(KeyListener)
Adds the specified key listener to receive key events from this component.
 o addMouseListener(MouseListener)
Adds the specified mouse listener to receive mouse events from this component.
 o addMouseMotionListener(MouseMotionListener)
Adds the specified mouse motion listener to receive mouse motion events from this component.
 o addNotify()
Notifies the Component that it has been added to a container and if a peer is required, it should be created.
 o bounds()
Deprecated.
 o checkImage(Image, ImageObserver)
Returns the status of the construction of a screen representation of the specified image.
 o checkImage(Image, int, int, ImageObserver)
Returns the status of the construction of a scaled screen representation of the specified image.
 o contains(int, int)
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this component.
 o contains(Point)
Checks whether this component "contains" the specified point, where x and y in the point are defined to be relative to the coordinate system of this component.
 o createImage(ImageProducer)
Creates an image from the specified image producer.
 o createImage(int, int)
Creates an off-screen drawable Image to be used for double buffering.
 o deliverEvent(Event)
Deprecated.
 o disable()
Deprecated.
 o disableEvents(long)
Disables the events defined by the specified event mask parameter from being delivered to this component.
 o dispatchEvent(AWTEvent)
Dispatches an event to this component or one of its sub components.
 o doLayout()
Lays out the component.
 o enable()
Deprecated.
 o enable(boolean)
Deprecated.
 o enableEvents(long)
Enables the events defined by the specified event mask parameter to be delivered to this component.
 o getAlignmentX()
Returns the alignment along the x axis.
 o getAlignmentY()
Returns the alignment along the y axis.
 o getBackground()
Gets the background color.
 o getBounds()
Returns the current bounds of this component.
 o getColorModel()
Gets the ColorModel used to display the component on the output device.
 o getComponentAt(int, int)
Returns the component or subcomponent that contains the x,y location.
 o getComponentAt(Point)
Returns the component or subcomponent that contains the specified point.
 o getCursor()
Gets the cursor set on this component.
 o getFont()
Gets the font of the component.
 o getFontMetrics(Font)
Gets the font metrics for this component.
 o getForeground()
Gets the foreground color.
 o getGraphics()
Gets a Graphics context for this component.
 o getLocale()
Gets the locale of the component.
 o getLocation()
Returns the current location of this component.
 o getLocationOnScreen()
Returns the current location of this component in the screen's coordinate space.
 o getMaximumSize()
Returns the maximum size of this component.
 o getMinimumSize()
Returns the mininimum size of this component.
 o getName()
Gets the name of the component.
 o getParent()
Gets the parent of the component.
 o getPeer()
Deprecated.
 o getPreferredSize()
Returns the preferred size of this component.
 o getSize()
Returns the current size of this component.
 o getToolkit()
Gets the toolkit of the component.
 o getTreeLock()
Gets the locking object for AWT component-tree and layout operations.
 o gotFocus(Event, Object)
Deprecated.
 o handleEvent(Event)
Deprecated.
 o hide()
Deprecated.
 o imageUpdate(Image, int, int, int, int, int)
Repaints the component when the image has changed.
 o inside(int, int)
Deprecated.
 o invalidate()
Invalidates the component.
 o isEnabled()
Checks if this Component is enabled.
 o isFocusTraversable()
Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
 o isShowing()
Checks if this Component is showing on screen.
 o isValid()
Checks if this Component is valid.
 o isVisible()
Checks if this Component is visible.
 o keyDown(Event, int)
Deprecated.
 o keyUp(Event, int)
Deprecated.
 o layout()
Deprecated.
 o list()
Prints a listing to System.out.
 o list(PrintStream)
Prints a listing to the specified print stream.
 o list(PrintStream, int)
Prints out a list, starting at the specified indention, to the specified print stream.
 o list(PrintWriter)
Prints a listing to the specified print writer.
 o list(PrintWriter, int)
Prints out a list, starting at the specified indention, to the specified print writer.
 o locate(int, int)
Deprecated.
 o location()
Deprecated.
 o lostFocus(Event, Object)
Deprecated.
 o minimumSize()
Deprecated.
 o mouseDown(Event, int, int)
Deprecated.
 o mouseDrag(Event, int, int)
Deprecated.
 o mouseEnter(Event, int, int)
Deprecated.
 o mouseExit(Event, int, int)
Deprecated.
 o mouseMove(Event, int, int)
Deprecated.
 o mouseUp(Event, int, int)
Deprecated.
 o move(int, int)
Deprecated.
 o nextFocus()
Deprecated.
 o paint(Graphics)
Paints the component.
 o paintAll(Graphics)
Paints the component and its subcomponents.
 o paramString()
Returns the parameter String of this Component.
 o postEvent(Event)
Deprecated.
 o preferredSize()
Deprecated.
 o prepareImage(Image, ImageObserver)
Prepares an image for rendering on this Component.
 o prepareImage(Image, int, int, ImageObserver)
Prepares an image for rendering on this Component at the specified width and height.
 o print(Graphics)
Prints this component.
 o printAll(Graphics)
Prints the component and its subcomponents.
 o processComponentEvent(ComponentEvent)
Processes component events occurring on this component by dispatching them to any registered ComponentListener objects.
 o processEvent(AWTEvent)
Processes events occurring on this component.
 o processFocusEvent(FocusEvent)
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.
 o processKeyEvent(KeyEvent)
Processes key events occurring on this component by dispatching them to any registered KeyListener objects.
 o processMouseEvent(MouseEvent)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
 o processMouseMotionEvent(MouseEvent)
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.
 o remove(MenuComponent)
Removes the specified popup menu from the component.
 o removeComponentListener(ComponentListener)
Removes the specified listener so it no longer receives component events from this component.
 o removeFocusListener(FocusListener)
Removes the specified focus listener so it no longer receives focus events from this component.
 o removeKeyListener(KeyListener)
Removes the specified key listener so it no longer receives key events from this component.
 o removeMouseListener(MouseListener)
Removes the specified mouse listener so it no longer receives mouse events from this component.
 o removeMouseMotionListener(MouseMotionListener)
Removes the specified mouse motion listener so it no longer receives mouse motion events from this component.
 o removeNotify()
Notifies the Component that it has been removed from its container and if a peers ecists, it destroys it.
 o repaint()
Repaints the component.
 o repaint(int, int, int, int)
Repaints part of the component.
 o repaint(long)
Repaints the component.
 o repaint(long, int, int, int, int)
Repaints part of the component.
 o requestFocus()
Requests the input focus.
 o reshape(int, int, int, int)
Deprecated.
 o resize(Dimension)
Deprecated.
 o resize(int, int)
Deprecated.
 o setBackground(Color)
Sets the background color.
 o setBounds(int, int, int, int)
Reshapes the Component to the specified bounding box.
 o setBounds(Rectangle)
Reshapes the Component to the specified bounding box.
 o setCursor(Cursor)
Set the cursor image to a predefined cursor.
 o setEnabled(boolean)
Enables a component.
 o setFont(Font)
Sets the font of the component.
 o setForeground(Color)
Sets the foreground color.
 o setLocale(Locale)
Sets the locale of the component.
 o setLocation(int, int)
Moves the Component to a new location.
 o setLocation(Point)
Moves the Component to a new location.
 o setName(String)
Sets the name of the component to the specified string.
 o setSize(Dimension)
Resizes the Component to the specified dimension.
 o setSize(int, int)
Resizes the Component to the specified width and height.
 o setVisible(boolean)
Shows or hides the component depending on the boolean flag b.
 o show()
Deprecated.
 o show(boolean)
Deprecated.
 o size()
Deprecated.
 o toString()
Returns the String representation of this Component's values.
 o transferFocus()
Transfers the focus to the next component.
 o update(Graphics)
Updates the component.
 o validate()
Ensures that a component has a valid layout.

Variables

 o locale
Properties Inheritable 
    locale=Locale 
The locale for the component.

See Also:
getLocale
 o TOP_ALIGNMENT
Properties Public Constant 
   TOP_ALIGNMENT=float 
Ease of use constant for getAlignmentY(). Specifies an alignment to the top of the component.

 o CENTER_ALIGNMENT
Properties Public Constant 
   CENTER_ALIGNMENT=float 
Ease of use constant for getAlignmentY() and getAlignmentX(). Specifies an alignment to the center of the component.

 o BOTTOM_ALIGNMENT
Properties Public Constant 
   BOTTOM_ALIGNMENT=float 
Ease of use constant for getAlignmentY(). Specifies an alignment to the bottom of the component.

 o LEFT_ALIGNMENT
Properties Public Constant 
   LEFT_ALIGNMENT=float 
Ease of use constant for getAlignmentX(). Specifies an alignment to the left side of the component.

 o RIGHT_ALIGNMENT
Properties Public Constant 
   RIGHT_ALIGNMENT=float 
Ease of use constant for getAlignmentX(). Specifies an alignment to the right side of the component.

Constructors

 o Component
    method Component() Inheritable 
Constructs a new Component. Components can be extended directly, but are lightweight in this case and must be hosted by a native container somewhere higher up in the component tree (such as a Frame for example).

Methods

 o getName
    method getName() returns String public     
Gets the name of the component.

 o setName
    method setName(name=String)  public     
Sets the name of the component to the specified string.

Parameters:
name - the name of the component.
 o getParent
    method getParent() returns Container public     
Gets the parent of the component.

 o getPeer
    method getPeer() returns ComponentPeer public     
Note: getPeer() is deprecated. As of JDK version 1.1, programs should not directly manipulate peers.

 o getTreeLock
    method getTreeLock() returns Object public   final  
Gets the locking object for AWT component-tree and layout operations.

 o getToolkit
    method getToolkit() returns Toolkit public     
Gets the toolkit of the component. This toolkit is used to create the peer for this component. Note that the Frame which contains a Component controls which toolkit is used so if the Component has not yet been added to a Frame or if it is later moved to a different Frame, the toolkit it uses may change.

 o isValid
    method isValid() returns boolean public     
Checks if this Component is valid. Components are invalidated when they are first shown on the screen.

See Also:
validate, invalidate
 o isVisible
    method isVisible() returns boolean public     
Checks if this Component is visible. Components are initially visible (with the exception of top level components such as Frame).

See Also:
setVisible
 o isShowing
    method isShowing() returns boolean public     
Checks if this Component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing.

See Also:
setVisible
 o isEnabled
    method isEnabled() returns boolean public     
Checks if this Component is enabled. Components are initially enabled.

See Also:
setEnabled
 o setEnabled
    method setEnabled(b=boolean)  public     
Enables a component.

See Also:
isEnabled
 o enable
    method enable()  public     
Note: enable() is deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).

 o enable
    method enable(b=boolean)  public     
Note: enable() is deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).

 o disable
    method disable()  public     
Note: disable() is deprecated. As of JDK version 1.1, replaced by setEnabled(boolean).

 o setVisible
    method setVisible(b=boolean)  public     
Shows or hides the component depending on the boolean flag b.

Parameters:
b - if true, show the component; otherwise, hide the component.
See Also:
isVisible
 o show
    method show()  public     
Note: show() is deprecated. As of JDK version 1.1, replaced by setVisible(boolean).

 o show
    method show(b=boolean)  public     
Note: show() is deprecated. As of JDK version 1.1, replaced by setVisible(boolean).

 o hide
    method hide()  public     
Note: hide() is deprecated. As of JDK version 1.1, replaced by setVisible(boolean).

 o getForeground
    method getForeground() returns Color public     
Gets the foreground color. If the component does not have a foreground color, the foreground color of its parent is returned.

See Also:
setForeground
 o setForeground
    method setForeground(c=Color)  public     
Sets the foreground color.

Parameters:
c - the Color
See Also:
getForeground
 o getBackground
    method getBackground() returns Color public     
Gets the background color. If the component does not have a background color, the background color of its parent is returned.

See Also:
setBackground
 o setBackground
    method setBackground(c=Color)  public     
Sets the background color.

Parameters:
c - the Color
See Also:
getBackground
 o getFont
    method getFont() returns Font public     
Gets the font of the component. If the component does not have a font, the font of its parent is returned.

See Also:
setFont
 o setFont
    method setFont(f=Font)  public    protect 
Sets the font of the component.

Parameters:
f - the font
See Also:
getFont
 o getLocale
    method getLocale() returns Locale public     
Gets the locale of the component. If the component does not have a locale, the locale of its parent is returned.

Throws: IllegalComponentStateException
If the Component does not have its own locale and has not yet been added to a containment hierarchy such that the locale can be determined from the containing parent.
See Also:
setLocale
 o setLocale
    method setLocale(l=Locale)  public     
Sets the locale of the component.

Parameters:
l - the locale
See Also:
getLocale
 o getColorModel
    method getColorModel() returns ColorModel public     
Gets the ColorModel used to display the component on the output device.

See Also:
ColorModel
 o getLocation
    method getLocation() returns Point public     
Returns the current location of this component. The location will be in the parent's coordinate space.

See Also:
setLocation
 o getLocationOnScreen
    method getLocationOnScreen() returns Point public     
Returns the current location of this component in the screen's coordinate space.

See Also:
setLocation, getLocation
 o location
    method location() returns Point public     
Note: location() is deprecated. As of JDK version 1.1, replaced by getLocation().

 o setLocation
    method setLocation(x=int, -
                       y=int)  public     
Moves the Component to a new location. The x and y coordinates are in the parent's coordinate space.

Parameters:
x - the x coordinate
y - the y coordinate
See Also:
getLocation, setBounds
 o move
    method move(x=int, -
                y=int)  public     
Note: move() is deprecated. As of JDK version 1.1, replaced by setLocation(int, int).

 o setLocation
    method setLocation(p=Point)  public     
Moves the Component to a new location. The point p is given in the parent's coordinate space.

Parameters:
p - the new location for the coordinate
See Also:
getLocation, setBounds
 o getSize
    method getSize() returns Dimension public     
Returns the current size of this component.

See Also:
setSize
 o size
    method size() returns Dimension public     
Note: size() is deprecated. As of JDK version 1.1, replaced by getSize().

 o setSize
    method setSize(width=int, -
                   height=int)  public     
Resizes the Component to the specified width and height.

Parameters:
width - the width of the component
height - the height of the component
See Also:
getSize, setBounds
 o resize
    method resize(width=int, -
                  height=int)  public     
Note: resize() is deprecated. As of JDK version 1.1, replaced by setSize(int, int).

 o setSize
    method setSize(d=Dimension)  public     
Resizes the Component to the specified dimension.

Parameters:
d - the component dimension
See Also:
setSize, setBounds
 o resize
    method resize(d=Dimension)  public     
Note: resize() is deprecated. As of JDK version 1.1, replaced by setSize(Dimension).

 o getBounds
    method getBounds() returns Rectangle public     
Returns the current bounds of this component.

See Also:
setBounds
 o bounds
    method bounds() returns Rectangle public     
Note: bounds() is deprecated. As of JDK version 1.1, replaced by getBounds().

 o setBounds
    method setBounds(x=int, -
                     y=int, -
                     width=int, -
                     height=int)  public     
Reshapes the Component to the specified bounding box.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the component
height - the height of the component
See Also:
getBounds, setLocation, setSize
 o reshape
    method reshape(x=int, -
                   y=int, -
                   width=int, -
                   height=int)  public     
Note: reshape() is deprecated. As of JDK version 1.1, replaced by setBounds(int, int, int, int).

 o setBounds
    method setBounds(r=Rectangle)  public     
Reshapes the Component to the specified bounding box.

Parameters:
r - the new bounding rectangle for the component
See Also:
getBounds, setLocation, setSize
 o getPreferredSize
    method getPreferredSize() returns Dimension public     
Returns the preferred size of this component.

See Also:
getMinimumSize, LayoutManager
 o preferredSize
    method preferredSize() returns Dimension public     
Note: preferredSize() is deprecated. As of JDK version 1.1, replaced by getPreferredSize().

 o getMinimumSize
    method getMinimumSize() returns Dimension public     
Returns the mininimum size of this component.

See Also:
getPreferredSize, LayoutManager
 o minimumSize
    method minimumSize() returns Dimension public     
Note: minimumSize() is deprecated. As of JDK version 1.1, replaced by getMinimumSize().

 o getMaximumSize
    method getMaximumSize() returns Dimension public     
Returns the maximum size of this component.

See Also:
getMinimumSize, getPreferredSize, LayoutManager
 o getAlignmentX
    method getAlignmentX() returns float public     
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

 o getAlignmentY
    method getAlignmentY() returns float public     
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

 o doLayout
    method doLayout()  public     
Lays out the component. This is usually called when the component (more specifically, container) is validated.

See Also:
validate, LayoutManager
 o layout
    method layout()  public     
Note: layout() is deprecated. As of JDK version 1.1, replaced by doLayout().

 o validate
    method validate()  public     
Ensures that a component has a valid layout. This method is primarily intended to operate on Container instances.

See Also:
invalidate, doLayout, LayoutManager, validate
 o invalidate
    method invalidate()  public     
Invalidates the component. The component and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly.

See Also:
validate, doLayout, LayoutManager
 o getGraphics
    method getGraphics() returns Graphics public     
Gets a Graphics context for this component. This method will return null if the component is currently not on the screen.

See Also:
paint
 o getFontMetrics
    method getFontMetrics(font=Font) returns FontMetrics public     
Gets the font metrics for this component.

Parameters:
font - the font
See Also:
getFont
 o setCursor
    method setCursor(cursor=Cursor)  public    protect 
Set the cursor image to a predefined cursor.

Parameters:
cursorType - one of the cursor constants defined above.
See Also:
Cursor
 o getCursor
    method getCursor() returns Cursor public     
Gets the cursor set on this component.

 o paint
    method paint(g=Graphics)  public     
Paints the component. This method is called when the contents of the component should be painted in response to the component first being shown or damage needing repair. The clip rectangle in the Graphics parameter will be set to the area which needs to be painted.

Parameters:
g - the specified Graphics window
See Also:
update
 o update
    method update(g=Graphics)  public     
Updates the component. This method is called in response to a call to repaint. You can assume that the background is not cleared.

Parameters:
g - the specified Graphics window
See Also:
paint, repaint
 o paintAll
    method paintAll(g=Graphics)  public     
Paints the component and its subcomponents.

Parameters:
g - the specified Graphics window
See Also:
paint
 o repaint
    method repaint()  public     
Repaints the component. This will result in a call to update as soon as possible.

See Also:
paint
 o repaint
    method repaint(tm=long)  public     
Repaints the component. This will result in a call to update within tm milliseconds.

Parameters:
tm - maximum time in milliseconds before update
See Also:
paint
 o repaint
    method repaint(x=int, -
                   y=int, -
                   width=int, -
                   height=int)  public     
Repaints part of the component. This will result in a call to update as soon as possible.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width
height - the height
See Also:
repaint
 o repaint
    method repaint(tm=long, -
                   x=int, -
                   y=int, -
                   width=int, -
                   height=int)  public     
Repaints part of the component. This will result in a call to update width tm millseconds.

Parameters:
tm - maximum time in milliseconds before update
x - the x coordinate
y - the y coordinate
width - the width
height - the height
See Also:
repaint
 o print
    method print(g=Graphics)  public     
Prints this component. The default implementation of this method calls paint.

Parameters:
g - the specified Graphics window
See Also:
paint
 o printAll
    method printAll(g=Graphics)  public     
Prints the component and its subcomponents.

Parameters:
g - the specified Graphics window
See Also:
print
 o imageUpdate
    method imageUpdate(img=Image, -
                       flags=int, -
                       x=int, -
                       y=int, -
                       w=int, -
                       h=int) returns boolean public     
Repaints the component when the image has changed.

Returns:
true if image has changed; false otherwise.
 o createImage
    method createImage(producer=ImageProducer) returns Image public     
Creates an image from the specified image producer.

Parameters:
producer - the image producer
 o createImage
    method createImage(width=int, -
                       height=int) returns Image public     
Creates an off-screen drawable Image to be used for double buffering.

Parameters:
width - the specified width
height - the specified height
 o prepareImage
    method prepareImage(image=Image, -
                        observer=ImageObserver) returns boolean public     
Prepares an image for rendering on this Component. The image data is downloaded asynchronously in another thread and the appropriate screen representation of the image is generated.

Parameters:
image - the Image to prepare a screen representation for
observer - the ImageObserver object to be notified as the image is being prepared
Returns:
true if the image has already been fully prepared
See Also:
ImageObserver
 o prepareImage
    method prepareImage(image=Image, -
                        width=int, -
                        height=int, -
                        observer=ImageObserver) returns boolean public     
Prepares an image for rendering on this Component at the specified width and height. The image data is downloaded asynchronously in another thread and an appropriately scaled screen representation of the image is generated.

Parameters:
image - the Image to prepare a screen representation for
width - the width of the desired screen representation
height - the height of the desired screen representation
observer - the ImageObserver object to be notified as the image is being prepared
Returns:
true if the image has already been fully prepared
See Also:
ImageObserver
 o checkImage
    method checkImage(image=Image, -
                      observer=ImageObserver) returns int public     
Returns the status of the construction of a screen representation of the specified image. This method does not cause the image to begin loading. Use the prepareImage method to force the loading of an image.

Parameters:
image - the Image to check the status of
observer - the ImageObserver object to be notified as the image is being prepared
Returns:
the boolean OR of the ImageObserver flags for the data that is currently available
See Also:
ImageObserver, prepareImage
 o checkImage
    method checkImage(image=Image, -
                      width=int, -
                      height=int, -
                      observer=ImageObserver) returns int public     
Returns the status of the construction of a scaled screen representation of the specified image. This method does not cause the image to begin loading, use the prepareImage method to force the loading of an image.

Parameters:
image - the Image to check the status of
width - the width of the scaled version to check the status of
height - the height of the scaled version to check the status of
observer - the ImageObserver object to be notified as the image is being prepared
Returns:
the boolean OR of the ImageObserver flags for the data that is currently available
See Also:
ImageObserver, prepareImage
 o contains
    method contains(x=int, -
                    y=int) returns boolean public     
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this component.

Parameters:
x - the x coordinate
y - the y coordinate
See Also:
getComponentAt
 o inside
    method inside(x=int, -
                  y=int) returns boolean public     
Note: inside() is deprecated. As of JDK version 1.1, replaced by contains(int, int).

 o contains
    method contains(p=Point) returns boolean public     
Checks whether this component "contains" the specified point, where x and y in the point are defined to be relative to the coordinate system of this component.

Parameters:
p - the point
See Also:
getComponentAt
 o getComponentAt
    method getComponentAt(x=int, -
                          y=int) returns Component public     
Returns the component or subcomponent that contains the x,y location.

Parameters:
x - the x coordinate
y - the y coordinate
See Also:
contains
 o locate
    method locate(x=int, -
                  y=int) returns Component public     
Note: locate() is deprecated. As of JDK version 1.1, replaced by getComponentAt(int, int).

 o getComponentAt
    method getComponentAt(p=Point) returns Component public     
Returns the component or subcomponent that contains the specified point.

Parameters:
p - the point
See Also:
contains
 o deliverEvent
    method deliverEvent(e=Event)  public     
Note: deliverEvent() is deprecated. As of JDK version 1.1

 o dispatchEvent
    method dispatchEvent(e=AWTEvent)  public   final  
Dispatches an event to this component or one of its sub components.

Parameters:
e - the event
 o postEvent
    method postEvent(e=Event) returns boolean public     
Note: postEvent() is deprecated. As of JDK version 1.1, replaced by dispatchEvent(AWTEvent).

 o addComponentListener
    method addComponentListener(l=ComponentListener)  public    protect 
Adds the specified component listener to receive component events from this component.

Parameters:
l - the component listener
 o removeComponentListener
    method removeComponentListener(l=ComponentListener)  public    protect 
Removes the specified listener so it no longer receives component events from this component.

Parameters:
l - the component listener
 o addFocusListener
    method addFocusListener(l=FocusListener)  public    protect 
Adds the specified focus listener to receive focus events from this component.

Parameters:
l - the focus listener
 o removeFocusListener
    method removeFocusListener(l=FocusListener)  public    protect 
Removes the specified focus listener so it no longer receives focus events from this component.

Parameters:
l - the focus listener
 o addKeyListener
    method addKeyListener(l=KeyListener)  public    protect 
Adds the specified key listener to receive key events from this component.

Parameters:
l - the key listener
 o removeKeyListener
    method removeKeyListener(l=KeyListener)  public    protect 
Removes the specified key listener so it no longer receives key events from this component.

Parameters:
l - the key listener
 o addMouseListener
    method addMouseListener(l=MouseListener)  public    protect 
Adds the specified mouse listener to receive mouse events from this component.

Parameters:
l - the mouse listener
 o removeMouseListener
    method removeMouseListener(l=MouseListener)  public    protect 
Removes the specified mouse listener so it no longer receives mouse events from this component.

Parameters:
l - the mouse listener
 o addMouseMotionListener
    method addMouseMotionListener(l=MouseMotionListener)  public    protect 
Adds the specified mouse motion listener to receive mouse motion events from this component.

Parameters:
l - the mouse motion listener
 o removeMouseMotionListener
    method removeMouseMotionListener(l=MouseMotionListener)  public    protect 
Removes the specified mouse motion listener so it no longer receives mouse motion events from this component.

Parameters:
l - the mouse motion listener
 o enableEvents
    method enableEvents(eventsToEnable=long)  Inheritable   final  
Enables the events defined by the specified event mask parameter to be delivered to this component. Event types are automatically enabled when a listener for that type is added to the component, therefore this method only needs to be invoked by subclasses of a component which desire to have the specified event types delivered to processEvent regardless of whether a listener is registered.

Parameters:
eventsToEnable - the event mask defining the event types
 o disableEvents
    method disableEvents(eventsToDisable=long)  Inheritable   final  
Disables the events defined by the specified event mask parameter from being delivered to this component.

Parameters:
eventsToDisable - the event mask defining the event types
 o processEvent
    method processEvent(e=AWTEvent)  Inheritable     
Processes events occurring on this component. By default this method will call the appropriate processXXXEvent method for the class of event. This method will not be called unless and event type is enabled for this component; this happens when one of the following occurs: a) A listener object is registered for that event type b) The event type is enabled via enableEvents() Classes overriding this method should call super.processEvent() to ensure default event processing continues normally.

Parameters:
e - the event
See Also:
enableEvents, processComponentEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent
 o processComponentEvent
    method processComponentEvent(e=ComponentEvent)  Inheritable     
Processes component events occurring on this component by dispatching them to any registered ComponentListener objects. NOTE: This method will not be called unless component events are enabled for this component; this happens when one of the following occurs: a) A ComponentListener object is registered via addComponentListner() b) Component events are enabled via enableEvents() Classes overriding this method should call super.processComponentEvent() to ensure default event processing continues normally.

Parameters:
e - the component event
 o processFocusEvent
    method processFocusEvent(e=FocusEvent)  Inheritable     
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects. NOTE: This method will not be called unless focus events are enabled for this component; this happens when one of the following occurs: a) A FocusListener object is registered via addFocusListener() b) Focus events are enabled via enableEvents() Classes overriding this method should call super.processFocusEvent() to ensure default event processing continues normally.

Parameters:
e - the focus event
 o processKeyEvent
    method processKeyEvent(e=KeyEvent)  Inheritable     
Processes key events occurring on this component by dispatching them to any registered KeyListener objects. NOTE: This method will not be called unless key events are enabled for this component; this happens when one of the following occurs: a) A KeyListener object is registered via addKeyListener() b) Key events are enabled via enableEvents() Classes overriding this method should call super.processKeyEvent() to ensure default event processing continues normally.

Parameters:
e - the key event
 o processMouseEvent
    method processMouseEvent(e=MouseEvent)  Inheritable     
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects. NOTE: This method will not be called unless mouse events are enabled for this component; this happens when one of the following occurs: a) A MouseListener object is registered via addMouseListener() b) Mouse events are enabled via enableEvents() Classes overriding this method should call super.processMouseEvent() to ensure default event processing continues normally.

Parameters:
e - the mouse event
 o processMouseMotionEvent
    method processMouseMotionEvent(e=MouseEvent)  Inheritable     
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects. NOTE: This method will not be called unless mouse motion events are enabled for this component; this happens when one of the following occurs: a) A MouseMotionListener object is registered via addMouseMotionListener() b) Mouse Motion events are enabled via enableEvents() Classes overriding this method should call super.processMouseMotionEvent() to ensure default event processing continues normally.

Parameters:
e - the mouse motion event
 o handleEvent
    method handleEvent(evt=Event) returns boolean public     
Note: handleEvent() is deprecated. As of JDK version 1.1 replaced by processEvent(AWTEvent).

 o mouseDown
    method mouseDown(evt=Event, -
                     x=int, -
                     y=int) returns boolean public     
Note: mouseDown() is deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

 o mouseDrag
    method mouseDrag(evt=Event, -
                     x=int, -
                     y=int) returns boolean public     
Note: mouseDrag() is deprecated. As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).

 o mouseUp
    method mouseUp(evt=Event, -
                   x=int, -
                   y=int) returns boolean public     
Note: mouseUp() is deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

 o mouseMove
    method mouseMove(evt=Event, -
                     x=int, -
                     y=int) returns boolean public     
Note: mouseMove() is deprecated. As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).

 o mouseEnter
    method mouseEnter(evt=Event, -
                      x=int, -
                      y=int) returns boolean public     
Note: mouseEnter() is deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

 o mouseExit
    method mouseExit(evt=Event, -
                     x=int, -
                     y=int) returns boolean public     
Note: mouseExit() is deprecated. As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).

 o keyDown
    method keyDown(evt=Event, -
                   key=int) returns boolean public     
Note: keyDown() is deprecated. As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).

 o keyUp
    method keyUp(evt=Event, -
                 key=int) returns boolean public     
Note: keyUp() is deprecated. As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).

 o action
    method action(evt=Event, -
                  what=Object) returns boolean public     
Note: action() is deprecated. As of JDK version 1.1, should register this component as ActionListener on component which fires action events.

 o addNotify
    method addNotify()  public     
Notifies the Component that it has been added to a container and if a peer is required, it should be created. This method should be called by Container.add, and not by user code directly.

See Also:
removeNotify
 o removeNotify
    method removeNotify()  public     
Notifies the Component that it has been removed from its container and if a peers ecists, it destroys it. This method should be called by Container.remove, and not by user code directly.

See Also:
addNotify
 o gotFocus
    method gotFocus(evt=Event, -
                    what=Object) returns boolean public     
Note: gotFocus() is deprecated. As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).

 o lostFocus
    method lostFocus(evt=Event, -
                     what=Object) returns boolean public     
Note: lostFocus() is deprecated. As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).

 o isFocusTraversable
    method isFocusTraversable() returns boolean public     
Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal. If this method returns "false", this component may still request the keyboard focus using requestFocus(), but it will not automatically be assigned focus during tab traversal.

 o requestFocus
    method requestFocus()  public     
Requests the input focus. A FocusGained event will be delivered if this request succeeds. The component must be visible on the screen for this request to be granted.

See Also:
FocusEvent, addFocusListener, processFocusEvent, isFocusTraversable
 o transferFocus
    method transferFocus()  public     
Transfers the focus to the next component.

See Also:
requestFocus
 o nextFocus
    method nextFocus()  public     
Note: nextFocus() is deprecated. As of JDK version 1.1, replaced by transferFocus().

 o add
    method add(popup=PopupMenu)  public    protect 
Adds the specified popup menu to the component.

Parameters:
popup - the popup menu to be added to the component
 o remove
    method remove(popup=MenuComponent)  public    protect 
Removes the specified popup menu from the component.

Parameters:
popup - the popup menu to be removed
 o paramString
    method paramString() returns String Inheritable     
Returns the parameter String of this Component.

 o toString
    method toString() returns String public     
Returns the String representation of this Component's values.

Overrides:
toString in class Object
 o list
    method list()  public     
Prints a listing to System.out.

 o list
    method list(out=PrintStream)  public     
Prints a listing to the specified print stream.

Parameters:
out - the Stream name
 o list
    method list(out=PrintStream, -
                indent=int)  public     
Prints out a list, starting at the specified indention, to the specified print stream.

Parameters:
out - the Stream name
indent - the start of the list
 o list
    method list(out=PrintWriter)  public     
Prints a listing to the specified print writer.

 o list
    method list(out=PrintWriter, -
                indent=int)  public     
Prints out a list, starting at the specified indention, to the specified print writer.


All Packages  Class Hierarchy  This Package  Previous  Next  Index