public class ComponentInputMap extends InputMap
InputMap
that is associated with a particular JComponent
.
The component is notified when its ComponentInputMap
changes.Constructor and Description |
---|
ComponentInputMap(JComponent comp)
Creates
ComponentInputMap object that notifies the given
component about changes to it. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the
InputMap . |
JComponent |
getComponent()
Returns the component to notify about changes.
|
void |
put(KeyStroke keystroke,
Object value)
Puts a new entry into the
InputMap . |
void |
remove(KeyStroke keystroke)
Remove an entry from the
InputMap . |
void |
setParent(InputMap parentMap)
Sets a parent for this
ComponentInputMap . |
public ComponentInputMap(JComponent comp)
ComponentInputMap
object that notifies the given
component about changes to it.comp
- the component to notifyIllegalArgumentException
- if comp is nullpublic void put(KeyStroke keystroke, Object value)
InputMap
.
If actionMapKey is null an existing entry will be removed.public void setParent(InputMap parentMap)
ComponentInputMap
.setParent
in class InputMap
parentMap
- the new parentIllegalArgumentException
- if parentMap is not a
ComponentInputMap
or not associated with the same componentInputMap.getParent()
public JComponent getComponent()
JComponent
object