public class

ComponentInputMap

extends InputMap
java.lang.Object
   ↳ javax.swing.InputMap
     ↳ javax.swing.ComponentInputMap
Known Direct Subclasses

Class Overview

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.

Summary

Public Constructors
ComponentInputMap(JComponent component)
Creates a ComponentInputMap associated with the specified component.
Public Methods
void clear()
Removes all the mappings from this object.
JComponent getComponent()
Returns the component the InputMap was created for.
void put(KeyStroke keyStroke, Object actionMapKey)
Adds a binding for keyStroke to actionMapKey.
void remove(KeyStroke key)
Removes the binding for key from this object.
void setParent(InputMap map)
Sets the parent, which must be a ComponentInputMap associated with the same component as this ComponentInputMap.
[Expand]
Inherited Methods
From class javax.swing.InputMap
From class java.lang.Object

Public Constructors

public ComponentInputMap (JComponent component)

Creates a ComponentInputMap associated with the specified component.

Parameters
component a non-null JComponent
Throws
IllegalArgumentException if component is null

Public Methods

public void clear ()

Removes all the mappings from this object.

public JComponent getComponent ()

Returns the component the InputMap was created for.

public void put (KeyStroke keyStroke, Object actionMapKey)

Adds a binding for keyStroke to actionMapKey. If actionMapKey is null, this removes the current binding for keyStroke.

public void remove (KeyStroke key)

Removes the binding for key from this object.

public void setParent (InputMap map)

Sets the parent, which must be a ComponentInputMap associated with the same component as this ComponentInputMap.

Parameters
map a ComponentInputMap
Throws
IllegalArgumentException if map is not a ComponentInputMap or is not associated with the same component