InputMap (Java Platform SE 8 ) (original) (raw)


public class InputMap
extends Object
implements Serializable
InputMap provides a binding between an input event (currently only KeyStrokes are used) and an Object. InputMaps are usually used with an ActionMap, to determine an Action to perform when a key is pressed. An InputMap can have a parent that is searched for bindings not defined in the InputMap.
As with ActionMap if you create a cycle, eg:
InputMap am = new InputMap();
InputMap bm = new InputMap():
am.setParent(bm);
bm.setParent(am);

some of the methods will cause a StackOverflowError to be thrown.
Since:
1.3

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.