public class ComponentInputMap extends InputMap
ComponentInputMap是与一个特定的
JComponent相关的
InputMap。组件自动通知每当
ComponentInputMap变化。
ComponentInputMaps用于
WHEN_IN_FOCUSED_WINDOW绑定。
| Constructor and Description |
|---|
ComponentInputMap(JComponent component)
创建一个具有指定组件相关的
ComponentInputMap。
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
从这个对象中移除所有的映射。
|
JComponent |
getComponent()
返回组件的
InputMap创建。
|
void |
put(KeyStroke keyStroke, Object actionMapKey)
添加一个绑定到
actionMapKey
keyStroke。
|
void |
remove(KeyStroke key)
删除绑定,从这个对象
key。
|
void |
setParent(InputMap map)
设置家长,这必须是一个组件,这
ComponentInputMap同相关
ComponentInputMap。
|
public ComponentInputMap(JComponent component)
ComponentInputMap。
component -一个非空的
JComponent
IllegalArgumentException -如果
component是空的
public void setParent(InputMap map)
ComponentInputMap同相关
ComponentInputMap。
setParent 方法重写,继承类
InputMap
map -
ComponentInputMap
IllegalArgumentException -如果
map不是
ComponentInputMap或不具有相同的组件相关的
public JComponent getComponent()
InputMap创建。
public void put(KeyStroke keyStroke, Object actionMapKey)
actionMapKey
keyStroke。如果
actionMapKey是null,这消除
keyStroke当前绑定的。
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.