| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| Modifier and Type | Method and Description | 
|---|---|
| static AWTKeyStroke | AWTKeyStroke. getAWTKeyStroke(char keyChar)Returns a shared instance of an  AWTKeyStrokethat represents aKEY_TYPEDevent for the
 specified character. | 
| static AWTKeyStroke | AWTKeyStroke. getAWTKeyStroke(Character keyChar,
               int modifiers)Returns a shared instance of an  AWTKeyStrokethat represents aKEY_TYPEDevent for the
 specified Character object and a set of modifiers. | 
| static AWTKeyStroke | AWTKeyStroke. getAWTKeyStroke(int keyCode,
               int modifiers)Returns a shared instance of an  AWTKeyStroke,
 given a numeric key code and a set of modifiers. | 
| static AWTKeyStroke | AWTKeyStroke. getAWTKeyStroke(int keyCode,
               int modifiers,
               boolean onKeyRelease)Returns a shared instance of an  AWTKeyStroke,
 given a numeric key code and a set of modifiers, specifying
 whether the key is activated when it is pressed or released. | 
| static AWTKeyStroke | AWTKeyStroke. getAWTKeyStroke(String s)Parses a string and returns an  AWTKeyStroke. | 
| static AWTKeyStroke | AWTKeyStroke. getAWTKeyStrokeForEvent(KeyEvent anEvent)Returns an  AWTKeyStrokewhich represents the
 stroke which generated a givenKeyEvent. | 
| Modifier and Type | Method and Description | 
|---|---|
| Set<AWTKeyStroke> | KeyboardFocusManager. getDefaultFocusTraversalKeys(int id)Returns a Set of default focus traversal keys for a given traversal
 operation. | 
| Set<AWTKeyStroke> | Component. getFocusTraversalKeys(int id)Returns the Set of focus traversal keys for a given traversal operation
 for this Component. | 
| Set<AWTKeyStroke> | Container. getFocusTraversalKeys(int id)Returns the Set of focus traversal keys for a given traversal operation
 for this Container. | 
| Set<AWTKeyStroke> | Window. getFocusTraversalKeys(int id)Gets a focus traversal key for this Window. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | KeyboardFocusManager. setDefaultFocusTraversalKeys(int id,
                            Set<? extends AWTKeyStroke> keystrokes)Sets the default focus traversal keys for a given traversal operation. | 
| void | Component. setFocusTraversalKeys(int id,
                     Set<? extends AWTKeyStroke> keystrokes)Sets the focus traversal keys for a given traversal operation for this
 Component. | 
| void | Container. setFocusTraversalKeys(int id,
                     Set<? extends AWTKeyStroke> keystrokes)Sets the focus traversal keys for a given traversal operation for this
 Container. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | KeyStrokeA KeyStroke represents a key action on the keyboard, or equivalent input
 device. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | JComponent. setFocusTraversalKeys(int id,
                     Set<? extends AWTKeyStroke> keystrokes)Sets the focus traversal keys for a given traversal operation for this
 Component. | 
 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.