public interface AccessibleComponent
The AccessibleContext.getAccessibleComponent() method
should return null if an object does not implement this
interface.
Accessible,
AccessibleContext,
AccessibleContext.getAccessibleComponent()| Modifier and Type | Method and Description |
|---|---|
void |
addFocusListener(java.awt.event.FocusListener listener)
Adds the specified listener to this component.
|
boolean |
contains(java.awt.Point point)
Tests whether or not the specified point is contained within
this component.
|
Accessible |
getAccessibleAt(java.awt.Point point)
If an object exists at the specified point which is a child of this
parent component, and it is accessible, then it is returned.
|
java.awt.Color |
getBackground()
Get the background color of this component.
|
java.awt.Rectangle |
getBounds()
Get the bounds of this component relative to its parent - it's width,
height, and relative location to its parent.
|
java.awt.Cursor |
getCursor()
Get the cursor of this component.
|
java.awt.Font |
getFont()
Get the font of this component
|
java.awt.FontMetrics |
getFontMetrics(java.awt.Font font)
Get the
FontMetrics of the specified font in this component. |
java.awt.Color |
getForeground()
Get the foreground color of this component.
|
java.awt.Point |
getLocation()
Get the location of this component in the parent's coordinate system.
|
java.awt.Point |
getLocationOnScreen()
Get the location of this component in the screen's coordinate space.
|
java.awt.Dimension |
getSize()
Get the size of this component - it's width and height.
|
boolean |
isEnabled()
Indicates whether or not this component is enabled.
|
boolean |
isFocusTraversable()
Indicates whether or not this component can accept focus.
|
boolean |
isShowing()
Indicates whether or not this component is visible by checking
the visibility of this component and its ancestors.
|
boolean |
isVisible()
Indicates whether or not this component is visible or intends to be
visible although one of its ancestors may not be.
|
void |
removeFocusListener(java.awt.event.FocusListener listener)
Removes the specified listener from this component.
|
void |
requestFocus()
If this method is called this component will attempt to gain focus,
but if it cannot accept focus nothing happens.
|
void |
setBackground(java.awt.Color color)
Set the background color of this component to the specified color.
|
void |
setBounds(java.awt.Rectangle rectangle)
Set the bounds of this component to the specified height and width, and
relative location to its parent.
|
void |
setCursor(java.awt.Cursor cursor)
Set the cursor of the component.
|
void |
setEnabled(boolean b)
Set this component to an enabled or disabled state.
|
void |
setFont(java.awt.Font font)
Set the font of this component.
|
void |
setForeground(java.awt.Color color)
Set the foreground color of this component.
|
void |
setLocation(java.awt.Point point)
Set the location of this component relative to its parent.
|
void |
setSize(java.awt.Dimension dimension)
Set the size of this component to the given dimensions.
|
void |
setVisible(boolean b)
Set the visible state of this component.
|
java.awt.Color getBackground()
setBackground(Color)void setBackground(java.awt.Color color)
color - the color to set the background togetBackground()java.awt.Color getForeground()
setForeground(Color)void setForeground(java.awt.Color color)
color - the color to set the foreground togetForeground()java.awt.Cursor getCursor()
setCursor(Cursor)void setCursor(java.awt.Cursor cursor)
cursor - the graphical representation of the cursor to usegetCursor()java.awt.Font getFont()
setFont(Font)void setFont(java.awt.Font font)
font - the font to usegetFont()java.awt.FontMetrics getFontMetrics(java.awt.Font font)
FontMetrics of the specified font in this component.font - the specified fontjava.lang.NullPointerException - if font is nullgetFont()boolean isEnabled()
setEnabled(boolean),
AccessibleContext.getAccessibleStateSet(),
AccessibleState.ENABLEDvoid setEnabled(boolean b)
b - true to enable the component, else disable itisEnabled()boolean isVisible()
isShowing() to see if the object is on screen.setVisible(boolean),
AccessibleContext.getAccessibleStateSet(),
AccessibleState.VISIBLEvoid setVisible(boolean b)
b - true to make the component visible, else hide itisVisible()boolean isShowing()
isVisible(),
setVisible(boolean),
AccessibleContext.getAccessibleStateSet(),
AccessibleState.SHOWINGboolean contains(java.awt.Point point)
point - the Point to locatejava.lang.NullPointerException - if point is nullgetBounds()java.awt.Point getLocationOnScreen()
getBounds(),
getLocation()java.awt.Point getLocation()
getBounds(),
getLocationOnScreen(),
setLocation(Point)void setLocation(java.awt.Point point)
point - the top-left corner of this component relative to the parentjava.lang.NullPointerException - if point is nullgetLocation()java.awt.Rectangle getBounds()
contains(Point)void setBounds(java.awt.Rectangle rectangle)
rectangle - the new height, width, and relative locationjava.lang.NullPointerException - if rectangle is nulljava.awt.Dimension getSize()
setSize(Dimension)void setSize(java.awt.Dimension dimension)
dimension - the new size of the componentjava.lang.NullPointerException - if dimension is nullgetSize()Accessible getAccessibleAt(java.awt.Point point)
point - the location within this component's coordinate systemboolean isFocusTraversable()
AccessibleContext.getAccessibleStateSet(),
AccessibleState.FOCUSABLE,
AccessibleState.FOCUSEDvoid requestFocus()
isFocusTraversable(),
AccessibleState.FOCUSEDvoid addFocusListener(java.awt.event.FocusListener listener)
listener - the listener to add to this componentremoveFocusListener(FocusListener)void removeFocusListener(java.awt.event.FocusListener listener)
listener - the listener to removeaddFocusListener(FocusListener)