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.
-
BOTTOM_ALIGNMENT
- Ease of use constant for getAlignmentY().
-
CENTER_ALIGNMENT
- Ease of use constant for getAlignmentY() and getAlignmentX().
-
LEFT_ALIGNMENT
- Ease of use constant for getAlignmentX().
-
locale
- The locale for the component.
-
RIGHT_ALIGNMENT
- Ease of use constant for getAlignmentX().
-
TOP_ALIGNMENT
- Ease of use constant for getAlignmentY().
-
Component()
- Constructs a new Component.
-
action(Event, Object)
-
Deprecated.
-
add(PopupMenu)
- Adds the specified popup menu to the component.
-
addComponentListener(ComponentListener)
- Adds the specified component listener to receive component events
from this component.
-
addFocusListener(FocusListener)
- Adds the specified focus listener to receive focus events
from this component.
-
addKeyListener(KeyListener)
- Adds the specified key listener to receive key events
from this component.
-
addMouseListener(MouseListener)
- Adds the specified mouse listener to receive mouse events
from this component.
-
addMouseMotionListener(MouseMotionListener)
- Adds the specified mouse motion listener to receive mouse motion events
from this component.
-
addNotify()
- Notifies the Component that it has been added to a container
and if a peer is required, it should be created.
-
bounds()
-
Deprecated.
-
checkImage(Image, ImageObserver)
- Returns the status of the construction of a screen representation
of the specified image.
-
checkImage(Image, int, int, ImageObserver)
- Returns the status of the construction of a scaled screen
representation of the specified image.
-
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.
-
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.
-
createImage(ImageProducer)
- Creates an image from the specified image producer.
-
createImage(int, int)
- Creates an off-screen drawable Image to be used for double buffering.
-
deliverEvent(Event)
-
Deprecated.
-
disable()
-
Deprecated.
-
disableEvents(long)
- Disables the events defined by the specified event mask parameter
from being delivered to this component.
-
dispatchEvent(AWTEvent)
- Dispatches an event to this component or one of its sub components.
-
doLayout()
- Lays out the component.
-
enable()
-
Deprecated.
-
enable(boolean)
-
Deprecated.
-
enableEvents(long)
- Enables the events defined by the specified event mask parameter
to be delivered to this component.
-
getAlignmentX()
- Returns the alignment along the x axis.
-
getAlignmentY()
- Returns the alignment along the y axis.
-
getBackground()
- Gets the background color.
-
getBounds()
-
Returns the current bounds of this component.
-
getColorModel()
- Gets the ColorModel used to display the component on the output device.
-
getComponentAt(int, int)
-
Returns the component or subcomponent that contains the x,y location.
-
getComponentAt(Point)
-
Returns the component or subcomponent that contains the
specified point.
-
getCursor()
- Gets the cursor set on this component.
-
getFont()
- Gets the font of the component.
-
getFontMetrics(Font)
- Gets the font metrics for this component.
-
getForeground()
- Gets the foreground color.
-
getGraphics()
- Gets a Graphics context for this component.
-
getLocale()
- Gets the locale of the component.
-
getLocation()
-
Returns the current location of this component.
-
getLocationOnScreen()
-
Returns the current location of this component in the screen's
coordinate space.
-
getMaximumSize()
-
Returns the maximum size of this component.
-
getMinimumSize()
- Returns the mininimum size of this component.
-
getName()
- Gets the name of the component.
-
getParent()
- Gets the parent of the component.
-
getPeer()
-
Deprecated.
-
getPreferredSize()
-
Returns the preferred size of this component.
-
getSize()
-
Returns the current size of this component.
-
getToolkit()
- Gets the toolkit of the component.
-
getTreeLock()
- Gets the locking object for AWT component-tree and layout
operations.
-
gotFocus(Event, Object)
-
Deprecated.
-
handleEvent(Event)
-
Deprecated.
-
hide()
-
Deprecated.
-
imageUpdate(Image, int, int, int, int, int)
- Repaints the component when the image has changed.
-
inside(int, int)
-
Deprecated.
-
invalidate()
-
Invalidates the component.
-
isEnabled()
- Checks if this Component is enabled.
-
isFocusTraversable()
- Returns whether this component can be traversed using
Tab or Shift-Tab keyboard focus traversal.
-
isShowing()
- Checks if this Component is showing on screen.
-
isValid()
- Checks if this Component is valid.
-
isVisible()
- Checks if this Component is visible.
-
keyDown(Event, int)
-
Deprecated.
-
keyUp(Event, int)
-
Deprecated.
-
layout()
-
Deprecated.
-
list()
- Prints a listing to System.out.
-
list(PrintStream)
- Prints a listing to the specified print stream.
-
list(PrintStream, int)
- Prints out a list, starting at the specified indention, to the specified
print stream.
-
list(PrintWriter)
- Prints a listing to the specified print writer.
-
list(PrintWriter, int)
- Prints out a list, starting at the specified indention, to the specified
print writer.
-
locate(int, int)
-
Deprecated.
-
location()
-
Deprecated.
-
lostFocus(Event, Object)
-
Deprecated.
-
minimumSize()
-
Deprecated.
-
mouseDown(Event, int, int)
-
Deprecated.
-
mouseDrag(Event, int, int)
-
Deprecated.
-
mouseEnter(Event, int, int)
-
Deprecated.
-
mouseExit(Event, int, int)
-
Deprecated.
-
mouseMove(Event, int, int)
-
Deprecated.
-
mouseUp(Event, int, int)
-
Deprecated.
-
move(int, int)
-
Deprecated.
-
nextFocus()
-
Deprecated.
-
paint(Graphics)
-
Paints the component.
-
paintAll(Graphics)
- Paints the component and its subcomponents.
-
paramString()
- Returns the parameter String of this Component.
-
postEvent(Event)
-
Deprecated.
-
preferredSize()
-
Deprecated.
-
prepareImage(Image, ImageObserver)
- Prepares an image for rendering on this Component.
-
prepareImage(Image, int, int, ImageObserver)
- Prepares an image for rendering on this Component at the
specified width and height.
-
print(Graphics)
- Prints this component.
-
printAll(Graphics)
- Prints the component and its subcomponents.
-
processComponentEvent(ComponentEvent)
-
Processes component events occurring on this component by
dispatching them to any registered ComponentListener objects.
-
processEvent(AWTEvent)
-
Processes events occurring on this component.
-
processFocusEvent(FocusEvent)
-
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects.
-
processKeyEvent(KeyEvent)
-
Processes key events occurring on this component by
dispatching them to any registered KeyListener objects.
-
processMouseEvent(MouseEvent)
-
Processes mouse events occurring on this component by
dispatching them to any registered MouseListener objects.
-
processMouseMotionEvent(MouseEvent)
-
Processes mouse motion events occurring on this component by
dispatching them to any registered MouseMotionListener objects.
-
remove(MenuComponent)
- Removes the specified popup menu from the component.
-
removeComponentListener(ComponentListener)
- Removes the specified listener so it no longer receives component
events from this component.
-
removeFocusListener(FocusListener)
- Removes the specified focus listener so it no longer receives focus
events from this component.
-
removeKeyListener(KeyListener)
- Removes the specified key listener so it no longer receives key
events from this component.
-
removeMouseListener(MouseListener)
- Removes the specified mouse listener so it no longer receives mouse
events from this component.
-
removeMouseMotionListener(MouseMotionListener)
- Removes the specified mouse motion listener so it no longer
receives mouse motion events from this component.
-
removeNotify()
-
Notifies the Component that it has been removed from its
container and if a peers ecists, it destroys it.
-
repaint()
-
Repaints the component.
-
repaint(int, int, int, int)
-
Repaints part of the component.
-
repaint(long)
-
Repaints the component.
-
repaint(long, int, int, int, int)
-
Repaints part of the component.
-
requestFocus()
-
Requests the input focus.
-
reshape(int, int, int, int)
-
Deprecated.
-
resize(Dimension)
-
Deprecated.
-
resize(int, int)
-
Deprecated.
-
setBackground(Color)
-
Sets the background color.
-
setBounds(int, int, int, int)
-
Reshapes the Component to the specified bounding box.
-
setBounds(Rectangle)
-
Reshapes the Component to the specified bounding box.
-
setCursor(Cursor)
- Set the cursor image to a predefined cursor.
-
setEnabled(boolean)
- Enables a component.
-
setFont(Font)
-
Sets the font of the component.
-
setForeground(Color)
-
Sets the foreground color.
-
setLocale(Locale)
-
Sets the locale of the component.
-
setLocation(int, int)
-
Moves the Component to a new location.
-
setLocation(Point)
-
Moves the Component to a new location.
-
setName(String)
- Sets the name of the component to the specified string.
-
setSize(Dimension)
-
Resizes the Component to the specified dimension.
-
setSize(int, int)
- Resizes the Component to the specified width and height.
-
setVisible(boolean)
- Shows or hides the component depending on the boolean flag b.
-
show()
-
Deprecated.
-
show(boolean)
-
Deprecated.
-
size()
-
Deprecated.
-
toString()
- Returns the String representation of this Component's values.
-
transferFocus()
- Transfers the focus to the next component.
-
update(Graphics)
-
Updates the component.
-
validate()
-
Ensures that a component has a valid layout.
locale
Properties Inheritable
locale=Locale
- The locale for the component.
- See Also:
- getLocale
TOP_ALIGNMENT
Properties Public Constant
TOP_ALIGNMENT=float
- Ease of use constant for getAlignmentY(). Specifies an
alignment to the top of the component.
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.
BOTTOM_ALIGNMENT
Properties Public Constant
BOTTOM_ALIGNMENT=float
- Ease of use constant for getAlignmentY(). Specifies an
alignment to the bottom of the component.
LEFT_ALIGNMENT
Properties Public Constant
LEFT_ALIGNMENT=float
- Ease of use constant for getAlignmentX(). Specifies an
alignment to the left side of the component.
RIGHT_ALIGNMENT
Properties Public Constant
RIGHT_ALIGNMENT=float
- Ease of use constant for getAlignmentX(). Specifies an
alignment to the right side of the component.
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).
getName
method getName() returns String public
- Gets the name of the component.
setName
method setName(name=String) public
- Sets the name of the component to the specified string.
- Parameters:
- name - the name of the component.
getParent
method getParent() returns Container public
- Gets the parent of the component.
getPeer
method getPeer() returns ComponentPeer public
- Note: getPeer() is deprecated.
As of JDK version 1.1,
programs should not directly manipulate peers.
getTreeLock
method getTreeLock() returns Object public final
- Gets the locking object for AWT component-tree and layout
operations.
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.
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
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
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
isEnabled
method isEnabled() returns boolean public
- Checks if this Component is enabled. Components are initially enabled.
- See Also:
- setEnabled
setEnabled
method setEnabled(b=boolean) public
- Enables a component.
- See Also:
- isEnabled
enable
method enable() public
- Note: enable() is deprecated.
As of JDK version 1.1,
replaced by setEnabled(boolean).
enable
method enable(b=boolean) public
- Note: enable() is deprecated.
As of JDK version 1.1,
replaced by setEnabled(boolean).
disable
method disable() public
- Note: disable() is deprecated.
As of JDK version 1.1,
replaced by setEnabled(boolean).
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
show
method show() public
- Note: show() is deprecated.
As of JDK version 1.1,
replaced by setVisible(boolean).
show
method show(b=boolean) public
- Note: show() is deprecated.
As of JDK version 1.1,
replaced by setVisible(boolean).
hide
method hide() public
- Note: hide() is deprecated.
As of JDK version 1.1,
replaced by setVisible(boolean).
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
setForeground
method setForeground(c=Color) public
- Sets the foreground color.
- Parameters:
- c - the Color
- See Also:
- getForeground
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
setBackground
method setBackground(c=Color) public
- Sets the background color.
- Parameters:
- c - the Color
- See Also:
- getBackground
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
setFont
method setFont(f=Font) public protect
- Sets the font of the component.
- Parameters:
- f - the font
- See Also:
- getFont
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
setLocale
method setLocale(l=Locale) public
- Sets the locale of the component.
- Parameters:
- l - the locale
- See Also:
- getLocale
getColorModel
method getColorModel() returns ColorModel public
- Gets the ColorModel used to display the component on the output device.
- See Also:
- ColorModel
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
getLocationOnScreen
method getLocationOnScreen() returns Point public
- Returns the current location of this component in the screen's
coordinate space.
- See Also:
- setLocation, getLocation
location
method location() returns Point public
- Note: location() is deprecated.
As of JDK version 1.1,
replaced by getLocation().
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
move
method move(x=int, -
y=int) public
- Note: move() is deprecated.
As of JDK version 1.1,
replaced by setLocation(int, int).
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
getSize
method getSize() returns Dimension public
- Returns the current size of this component.
- See Also:
- setSize
size
method size() returns Dimension public
- Note: size() is deprecated.
As of JDK version 1.1,
replaced by getSize().
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
resize
method resize(width=int, -
height=int) public
- Note: resize() is deprecated.
As of JDK version 1.1,
replaced by setSize(int, int).
setSize
method setSize(d=Dimension) public
- Resizes the Component to the specified dimension.
- Parameters:
- d - the component dimension
- See Also:
- setSize, setBounds
resize
method resize(d=Dimension) public
- Note: resize() is deprecated.
As of JDK version 1.1,
replaced by setSize(Dimension).
getBounds
method getBounds() returns Rectangle public
- Returns the current bounds of this component.
- See Also:
- setBounds
bounds
method bounds() returns Rectangle public
- Note: bounds() is deprecated.
As of JDK version 1.1,
replaced by getBounds().
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
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).
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
getPreferredSize
method getPreferredSize() returns Dimension public
- Returns the preferred size of this component.
- See Also:
- getMinimumSize, LayoutManager
preferredSize
method preferredSize() returns Dimension public
- Note: preferredSize() is deprecated.
As of JDK version 1.1,
replaced by getPreferredSize().
getMinimumSize
method getMinimumSize() returns Dimension public
- Returns the mininimum size of this component.
- See Also:
- getPreferredSize, LayoutManager
minimumSize
method minimumSize() returns Dimension public
- Note: minimumSize() is deprecated.
As of JDK version 1.1,
replaced by getMinimumSize().
getMaximumSize
method getMaximumSize() returns Dimension public
- Returns the maximum size of this component.
- See Also:
- getMinimumSize, getPreferredSize, LayoutManager
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.
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.
doLayout
method doLayout() public
- Lays out the component. This is usually called when the
component (more specifically, container) is validated.
- See Also:
- validate, LayoutManager
layout
method layout() public
- Note: layout() is deprecated.
As of JDK version 1.1,
replaced by doLayout().
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
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
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
getFontMetrics
method getFontMetrics(font=Font) returns FontMetrics public
- Gets the font metrics for this component.
- Parameters:
- font - the font
- See Also:
- getFont
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
getCursor
method getCursor() returns Cursor public
- Gets the cursor set on this component.
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
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
paintAll
method paintAll(g=Graphics) public
- Paints the component and its subcomponents.
- Parameters:
- g - the specified Graphics window
- See Also:
- paint
repaint
method repaint() public
- Repaints the component. This will result in a
call to update as soon as possible.
- See Also:
- paint
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
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
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
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
printAll
method printAll(g=Graphics) public
- Prints the component and its subcomponents.
- Parameters:
- g - the specified Graphics window
- See Also:
- print
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.
createImage
method createImage(producer=ImageProducer) returns Image public
- Creates an image from the specified image producer.
- Parameters:
- producer - the image producer
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
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
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
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
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
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
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).
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
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
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).
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
deliverEvent
method deliverEvent(e=Event) public
- Note: deliverEvent() is deprecated.
As of JDK version 1.1
dispatchEvent
method dispatchEvent(e=AWTEvent) public final
- Dispatches an event to this component or one of its sub components.
- Parameters:
- e - the event
postEvent
method postEvent(e=Event) returns boolean public
- Note: postEvent() is deprecated.
As of JDK version 1.1,
replaced by dispatchEvent(AWTEvent).
addComponentListener
method addComponentListener(l=ComponentListener) public protect
- Adds the specified component listener to receive component events
from this component.
- Parameters:
- l - the component listener
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
addFocusListener
method addFocusListener(l=FocusListener) public protect
- Adds the specified focus listener to receive focus events
from this component.
- Parameters:
- l - the focus listener
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
addKeyListener
method addKeyListener(l=KeyListener) public protect
- Adds the specified key listener to receive key events
from this component.
- Parameters:
- l - the key listener
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
addMouseListener
method addMouseListener(l=MouseListener) public protect
- Adds the specified mouse listener to receive mouse events
from this component.
- Parameters:
- l - the mouse listener
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
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
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
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
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
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
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
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
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
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
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
handleEvent
method handleEvent(evt=Event) returns boolean public
- Note: handleEvent() is deprecated.
As of JDK version 1.1
replaced by processEvent(AWTEvent).
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).
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).
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).
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).
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).
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).
keyDown
method keyDown(evt=Event, -
key=int) returns boolean public
- Note: keyDown() is deprecated.
As of JDK version 1.1,
replaced by processKeyEvent(KeyEvent).
keyUp
method keyUp(evt=Event, -
key=int) returns boolean public
- Note: keyUp() is deprecated.
As of JDK version 1.1,
replaced by processKeyEvent(KeyEvent).
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.
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
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
gotFocus
method gotFocus(evt=Event, -
what=Object) returns boolean public
- Note: gotFocus() is deprecated.
As of JDK version 1.1,
replaced by processFocusEvent(FocusEvent).
lostFocus
method lostFocus(evt=Event, -
what=Object) returns boolean public
- Note: lostFocus() is deprecated.
As of JDK version 1.1,
replaced by processFocusEvent(FocusEvent).
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.
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
transferFocus
method transferFocus() public
- Transfers the focus to the next component.
- See Also:
- requestFocus
nextFocus
method nextFocus() public
- Note: nextFocus() is deprecated.
As of JDK version 1.1,
replaced by transferFocus().
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
remove
method remove(popup=MenuComponent) public protect
- Removes the specified popup menu from the component.
- Parameters:
- popup - the popup menu to be removed
paramString
method paramString() returns String Inheritable
- Returns the parameter String of this Component.
toString
method toString() returns String public
- Returns the String representation of this Component's values.
- Overrides:
- toString in class Object
list
method list() public
- Prints a listing to System.out.
list
method list(out=PrintStream) public
- Prints a listing to the specified print stream.
- Parameters:
- out - the Stream name
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
list
method list(out=PrintWriter) public
- Prints a listing to the specified print writer.
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