| Package | Description | 
|---|---|
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| javax.swing.plaf.basic | Provides user interface objects built according to the
Basic look and feel. | 
| javax.swing.text | Provides classes and interfaces that deal with editable
and noneditable text components. | 
| Modifier and Type | Method and Description | 
|---|---|
| KeyStroke[] | InputMap. allKeys()Returns an array of the  KeyStrokes defined in thisInputMapand its parent. | 
| KeyStroke | JMenuItem. getAccelerator()Returns the  KeyStrokewhich serves as an accelerator
 for the menu item. | 
| static KeyStroke | KeyStroke. getKeyStroke(char keyChar)Returns a shared instance of a  KeyStrokethat represents aKEY_TYPEDevent for the
 specified character. | 
| static KeyStroke | KeyStroke. getKeyStroke(Character keyChar,
            int modifiers)Returns a shared instance of a  KeyStrokethat represents aKEY_TYPEDevent for the
 specified Character object and a
 set of modifiers. | 
| static KeyStroke | KeyStroke. getKeyStroke(char keyChar,
            boolean onKeyRelease)Deprecated. 
 use getKeyStroke(char) | 
| static KeyStroke | KeyStroke. getKeyStroke(int keyCode,
            int modifiers)Returns a shared instance of a KeyStroke, given a numeric key code and a
 set of modifiers. | 
| static KeyStroke | KeyStroke. getKeyStroke(int keyCode,
            int modifiers,
            boolean onKeyRelease)Returns a shared instance of a KeyStroke, given a numeric key code and a
 set of modifiers, specifying whether the key is activated when it is
 pressed or released. | 
| static KeyStroke | KeyStroke. getKeyStroke(String s)Parses a string and returns a  KeyStroke. | 
| static KeyStroke | KeyStroke. getKeyStrokeForEvent(KeyEvent anEvent)Returns a KeyStroke which represents the stroke which generated a given
 KeyEvent. | 
| KeyStroke[] | JComponent. getRegisteredKeyStrokes()Returns the  KeyStrokesthat will initiate
 registered actions. | 
| KeyStroke[] | InputMap. keys()Returns the  KeyStrokes that are bound in thisInputMap. | 
| Modifier and Type | Method and Description | 
|---|---|
| Object | InputMap. get(KeyStroke keyStroke)Returns the binding for  keyStroke, messaging the
 parentInputMapif the binding is not locally defined. | 
| ActionListener | JComponent. getActionForKeyStroke(KeyStroke aKeyStroke)Returns the object that will perform the action registered for a
 given keystroke. | 
| int | JComponent. getConditionForKeyStroke(KeyStroke aKeyStroke)Returns the condition that determines whether a registered action
 occurs in response to the specified keystroke. | 
| static boolean | SwingUtilities. notifyAction(Action action,
            KeyStroke ks,
            KeyEvent event,
            Object sender,
            int modifiers)Invokes  actionPerformedonactionifactionis enabled (and non-null). | 
| protected boolean | JMenuBar. processKeyBinding(KeyStroke ks,
                 KeyEvent e,
                 int condition,
                 boolean pressed)Subclassed to check all the child menus. | 
| protected boolean | JTable. processKeyBinding(KeyStroke ks,
                 KeyEvent e,
                 int condition,
                 boolean pressed) | 
| protected boolean | JComponent. processKeyBinding(KeyStroke ks,
                 KeyEvent e,
                 int condition,
                 boolean pressed)Invoked to process the key bindings for  ksas the result
 of theKeyEvente. | 
| void | InputMap. put(KeyStroke keyStroke,
   Object actionMapKey)Adds a binding for  keyStroketoactionMapKey. | 
| void | ComponentInputMap. put(KeyStroke keyStroke,
   Object actionMapKey)Adds a binding for  keyStroketoactionMapKey. | 
| void | JComponent. registerKeyboardAction(ActionListener anAction,
                      KeyStroke aKeyStroke,
                      int aCondition)This method is now obsolete, please use a combination of
  getActionMap()andgetInputMap()for
 similiar behavior. | 
| void | JComponent. registerKeyboardAction(ActionListener anAction,
                      String aCommand,
                      KeyStroke aKeyStroke,
                      int aCondition)This method is now obsolete, please use a combination of
  getActionMap()andgetInputMap()for
 similiar behavior. | 
| void | InputMap. remove(KeyStroke key)Removes the binding for  keyfrom thisInputMap. | 
| void | ComponentInputMap. remove(KeyStroke key)Removes the binding for  keyfrom this object. | 
| void | JMenu. setAccelerator(KeyStroke keyStroke)setAcceleratoris not defined forJMenu. | 
| void | JMenuItem. setAccelerator(KeyStroke keyStroke)Sets the key combination which invokes the menu item's
 action listeners without navigating the menu hierarchy. | 
| void | JComponent. unregisterKeyboardAction(KeyStroke aKeyStroke)This method is now obsolete. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected KeyStroke | BasicDesktopPaneUI. closeKeyDeprecated. 
 As of 1.3. | 
| protected KeyStroke | BasicSplitPaneUI. dividerResizeToggleKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicToolBarUI. downKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicSplitPaneUI. downKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicTabbedPaneUI. downKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicSplitPaneUI. endKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicSplitPaneUI. homeKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicToolBarUI. leftKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicSplitPaneUI. leftKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicTabbedPaneUI. leftKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicDesktopPaneUI. maximizeKeyDeprecated. 
 As of 1.3. | 
| protected KeyStroke | BasicDesktopPaneUI. minimizeKeyDeprecated. 
 As of 1.3. | 
| protected KeyStroke | BasicDesktopPaneUI. navigateKeyDeprecated. 
 As of 1.3. | 
| protected KeyStroke | BasicDesktopPaneUI. navigateKey2Deprecated. 
 As of 1.3. | 
| protected KeyStroke | BasicInternalFrameUI. openMenuKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicToolBarUI. rightKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicSplitPaneUI. rightKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicTabbedPaneUI. rightKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicToolBarUI. upKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicSplitPaneUI. upKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| protected KeyStroke | BasicTabbedPaneUI. upKeyDeprecated. 
 As of Java 2 platform v1.3. | 
| Modifier and Type | Field and Description | 
|---|---|
| KeyStroke | JTextComponent.KeyBinding. keyThe key. | 
| Modifier and Type | Method and Description | 
|---|---|
| KeyStroke[] | Keymap. getBoundKeyStrokes()Fetches all of the keystrokes in this map that
 are bound to some action. | 
| KeyStroke[] | Keymap. getKeyStrokesForAction(Action a)Fetches the keystrokes that will result in
 the given action. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | Keymap. addActionForKeyStroke(KeyStroke key,
                     Action a)Adds a binding to the keymap. | 
| Action | Keymap. getAction(KeyStroke key)Fetches the action appropriate for the given symbolic
 event sequence. | 
| boolean | Keymap. isLocallyDefined(KeyStroke key)Determines if the given key sequence is locally defined. | 
| void | Keymap. removeKeyStrokeBinding(KeyStroke keys)Removes a binding from the keymap. | 
| Constructor and Description | 
|---|
| JTextComponent.KeyBinding(KeyStroke key,
                         String actionName)Creates a new key binding. | 
 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, 2013, Oracle and/or its affiliates.  All rights reserved.