javax.swing
Class KeyStroke
java.lang.Object
java.awt.AWTKeyStroke
javax.swing.KeyStroke
- All Implemented Interfaces:
- Serializable
public class KeyStroke
- extends AWTKeyStroke
- implements Serializable
- See Also:
- Serialized Form
Methods inherited from class java.awt.AWTKeyStroke |
equals, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStrokeForEvent, getKeyChar, getKeyCode, getKeyEventType, getModifiers, hashCode, isOnKeyRelease, readResolve, registerSubclass, toString |
getKeyStroke
public static KeyStroke getKeyStroke(char keyChar)
getKeyStroke
public static KeyStroke getKeyStroke(char keyChar,
boolean onKeyRelease)
- Deprecated. Use
getKeyStroke(char)
This method, unlike all the other factory methods on this object,
returns a non-cached, non-shared object. New code should not use it.
getKeyStroke
public static KeyStroke getKeyStroke(Character keyChar,
int modifiers)
getKeyStroke
public static KeyStroke getKeyStroke(int keyCode,
int modifiers,
boolean onKeyRelease)
getKeyStroke
public static KeyStroke getKeyStroke(int keyCode,
int modifiers)
getKeyStroke
public static KeyStroke getKeyStroke(String str)
- Returns the KeyStroke according to
getAWTKeyStroke()
.
But it returns null instead of throwing
IllegalArugmentException
when
the keystoke sequence cannot be parsed from the given string.
getKeyStrokeForEvent
public static KeyStroke getKeyStrokeForEvent(KeyEvent event)