javax.swing
public class KeyStroke extends AWTKeyStroke implements Serializable
Modifier and Type | Method and Description |
---|---|
static KeyStroke |
getKeyStroke(char keyChar) |
static KeyStroke |
getKeyStroke(Character keyChar,
int modifiers) |
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. |
static KeyStroke |
getKeyStroke(int keyCode,
int modifiers) |
static KeyStroke |
getKeyStroke(int keyCode,
int modifiers,
boolean onKeyRelease) |
static KeyStroke |
getKeyStroke(String str)
Returns the KeyStroke according to
getAWTKeyStroke() . |
static KeyStroke |
getKeyStrokeForEvent(KeyEvent event) |
equals, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStroke, getAWTKeyStrokeForEvent, getKeyChar, getKeyCode, getKeyEventType, getModifiers, hashCode, isOnKeyRelease, readResolve, registerSubclass, toString
public static KeyStroke getKeyStroke(char keyChar)
public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease)
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.public static KeyStroke getKeyStroke(Character keyChar, int modifiers)
public static KeyStroke getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease)
public static KeyStroke getKeyStroke(int keyCode, int modifiers)
public static KeyStroke getKeyStroke(String str)
getAWTKeyStroke()
.
But it returns null instead of throwing
IllegalArugmentException
when
the keystoke sequence cannot be parsed from the given string.public static KeyStroke getKeyStrokeForEvent(KeyEvent event)