- java.lang.Object
- 
- javax.swing.InputMap
- 
- javax.swing.ComponentInputMap
 
 
- 
- All Implemented Interfaces:
- Serializable
 - Direct Known Subclasses:
- ComponentInputMapUIResource
 
 public class ComponentInputMap extends InputMap AComponentInputMapis anInputMapassociated with a particularJComponent. The component is automatically notified whenever theComponentInputMapchanges.ComponentInputMaps are used forWHEN_IN_FOCUSED_WINDOWbindings.- Since:
- 1.3
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ComponentInputMap(JComponent component)Creates aComponentInputMapassociated with the specified component.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all the mappings from this object.JComponentgetComponent()Returns the component theInputMapwas created for.voidput(KeyStroke keyStroke, Object actionMapKey)Adds a binding forkeyStroketoactionMapKey.voidremove(KeyStroke key)Removes the binding forkeyfrom this object.voidsetParent(InputMap map)Sets the parent, which must be aComponentInputMapassociated with the same component as thisComponentInputMap.
 
- 
- 
- 
Constructor Detail- 
ComponentInputMappublic ComponentInputMap(JComponent component) Creates aComponentInputMapassociated with the specified component.- Parameters:
- component- a non-null- JComponent
- Throws:
- IllegalArgumentException- if- componentis null
 
 
- 
 - 
Method Detail- 
setParentpublic void setParent(InputMap map) Sets the parent, which must be aComponentInputMapassociated with the same component as thisComponentInputMap.- Overrides:
- setParentin class- InputMap
- Parameters:
- map- a- ComponentInputMap
- Throws:
- IllegalArgumentException- if- mapis not a- ComponentInputMapor is not associated with the same component
 
 - 
getComponentpublic JComponent getComponent() Returns the component theInputMapwas created for.- Returns:
- the component the InputMapwas created for.
 
 - 
putpublic void put(KeyStroke keyStroke, Object actionMapKey) Adds a binding forkeyStroketoactionMapKey. IfactionMapKeyis null, this removes the current binding forkeyStroke.
 - 
removepublic void remove(KeyStroke key) Removes the binding forkeyfrom this object.
 
- 
 
-