java.lang.Object
javax.swing.InputMap
javax.swing.ComponentInputMap
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ComponentInputMapUIResource
public class ComponentInputMap extends InputMap
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 SummaryConstructors Constructor Description ComponentInputMap(JComponent component)Creates aComponentInputMapassociated with the specified component.
- 
Method SummaryModifier 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 Details- 
ComponentInputMapCreates aComponentInputMapassociated with the specified component.- Parameters:
- component- a non-null- JComponent
- Throws:
- IllegalArgumentException- if- componentis null
 
 
- 
- 
Method Details- 
setParentSets 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
 
- 
getComponentReturns the component theInputMapwas created for.- Returns:
- the component the InputMapwas created for.
 
- 
putAdds a binding forkeyStroketoactionMapKey. IfactionMapKeyis null, this removes the current binding forkeyStroke.
- 
removeRemoves the binding forkeyfrom this object.
- 
clearpublic void clear()Removes all the mappings from this object.
 
-