public interface AccessibleComponent
AccessibleContext.getAccessibleComponent()
方法。如果返回值不是为空,对象支持此接口。
Modifier and Type | Method and Description |
---|---|
void |
addFocusListener(FocusListener l)
添加指定的焦点侦听器以从该组件接收焦点事件。
|
boolean |
contains(Point p)
检查指定的点是否在这个对象的范围内,其中的点的X和Y坐标被定义为相对于对象的坐标系统。
|
Accessible |
getAccessibleAt(Point p)
返回可访问的子,如果一个存在,包含在局部坐标点上。
|
Color |
getBackground()
获取此对象的背景颜色。
|
Rectangle |
getBounds()
以一个矩形对象的形式获取此对象的边界。
|
Cursor |
getCursor()
获取此对象的光标。
|
Font |
getFont()
获取此对象的字体。
|
FontMetrics |
getFontMetrics(Font f)
获取此对象的根据。
|
Color |
getForeground()
获取此对象的前景色。
|
Point |
getLocation()
获取对象的位置相对于父在一个点指定对象的左上角在屏幕的坐标空间中的形式。
|
Point |
getLocationOnScreen()
返回屏幕上的对象的位置。
|
Dimension |
getSize()
以维度对象的形式返回此对象的大小。
|
boolean |
isEnabled()
确定是否启用了对象。
|
boolean |
isFocusTraversable()
返回这个对象是否可以接受焦点。
|
boolean |
isShowing()
确定对象是否显示。
|
boolean |
isVisible()
确定对象是否可见。
|
void |
removeFocusListener(FocusListener l)
移除指定的焦点侦听器,所以它不再接收来自该组件的焦点事件。
|
void |
requestFocus()
请求此对象的焦点。
|
void |
setBackground(Color c)
设置此对象的背景颜色。
|
void |
setBounds(Rectangle r)
以一个矩形对象的形式设置此对象的边界。
|
void |
setCursor(Cursor cursor)
设置此对象的光标。
|
void |
setEnabled(boolean b)
设置对象的启用状态。
|
void |
setFont(Font f)
设置此对象的字体。
|
void |
setForeground(Color c)
设置此对象的前景色。
|
void |
setLocation(Point p)
设置相对于父对象的对象的位置。
|
void |
setSize(Dimension d)
调整此对象使它的宽度和高度。
|
void |
setVisible(boolean b)
设置对象的可见状态。
|
Color getBackground()
setBackground(java.awt.Color)
void setBackground(Color c)
c
为背景的新的颜色
setBackground(java.awt.Color)
Color getForeground()
setForeground(java.awt.Color)
void setForeground(Color c)
c
为前景的新颜色
getForeground()
Cursor getCursor()
setCursor(java.awt.Cursor)
void setCursor(Cursor cursor)
cursor
为对象的新指针
getCursor()
Font getFont()
setFont(java.awt.Font)
FontMetrics getFontMetrics(Font f)
f
-字体
getFont()
boolean isEnabled()
setEnabled(boolean)
,
AccessibleContext.getAccessibleStateSet()
,
AccessibleState.ENABLED
,
AccessibleStateSet
void setEnabled(boolean b)
b
-如果属实,使该对象;否则,禁用它
isEnabled()
boolean isVisible()
这是可见的物体也会有accessiblestate.visible状态设置在accessiblestatesets。
setVisible(boolean)
,
AccessibleContext.getAccessibleStateSet()
,
AccessibleState.VISIBLE
,
AccessibleStateSet
void setVisible(boolean b)
b
-如果属实,表明该对象;否则,隐藏它
isVisible()
boolean isShowing()
boolean contains(Point p)
p
-点的对象的坐标系统
getBounds()
Point getLocationOnScreen()
getBounds()
,
getLocation()
Point getLocation()
getBounds()
,
getLocationOnScreen()
void setLocation(Point p)
p
-左上角的新位置
getLocation()
Rectangle getBounds()
contains(java.awt.Point)
void setBounds(Rectangle r)
r
矩形指示该组件的边界
getBounds()
Dimension getSize()
setSize(java.awt.Dimension)
Accessible getAccessibleAt(Point p)
p
-点此对象的坐标系统。
boolean isFocusTraversable()
AccessibleContext.getAccessibleStateSet()
,
AccessibleState.FOCUSABLE
,
AccessibleState.FOCUSED
,
AccessibleStateSet
void requestFocus()
isFocusTraversable()
void addFocusListener(FocusListener l)
l
焦点-听众
removeFocusListener(java.awt.event.FocusListener)
void removeFocusListener(FocusListener l)
l
焦点-听众
addFocusListener(java.awt.event.FocusListener)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.