java.lang.Object
javax.swing.InputMap
javax.swing.ComponentInputMap
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ComponentInputMapUIResource
A
ComponentInputMap is an InputMap
associated with a particular JComponent.
The component is automatically notified whenever
the ComponentInputMap changes.
ComponentInputMaps are used for
WHEN_IN_FOCUSED_WINDOW bindings.- Since:
- 1.3
-
Constructor Summary
ConstructorsConstructorDescriptionComponentInputMap(JComponent component) Creates aComponentInputMapassociated with the specified component. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all the mappings from this object.Returns the component theInputMapwas created for.voidAdds a binding forkeyStroketoactionMapKey.voidRemoves the binding forkeyfrom this object.voidSets the parent, which must be aComponentInputMapassociated with the same component as thisComponentInputMap.
-
Constructor Details
-
ComponentInputMap
Creates aComponentInputMapassociated with the specified component.- Parameters:
component- a non-nullJComponent- Throws:
IllegalArgumentException- ifcomponentis null
-
-
Method Details
-
setParent
Sets the parent, which must be aComponentInputMapassociated with the same component as thisComponentInputMap.- Overrides:
setParentin classInputMap- Parameters:
map- aComponentInputMap- Throws:
IllegalArgumentException- ifmapis not aComponentInputMapor is not associated with the same component
-
getComponent
Returns the component theInputMapwas created for.- Returns:
- the component the
InputMapwas created for.
-
put
Adds a binding forkeyStroketoactionMapKey. IfactionMapKeyis null, this removes the current binding forkeyStroke. -
remove
Removes the binding forkeyfrom this object. -
clear
public void clear()Removes all the mappings from this object.
-