public class ComponentInputMap extends InputMap
ComponentInputMap
是与一个特定的
JComponent
相关的
InputMap
。组件自动通知每当
ComponentInputMap
变化。
ComponentInputMap
s用于
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.