javax.swing

Class KeyStroke

public class KeyStroke extends AWTKeyStroke implements Serializable

Method Summary
static KeyStrokegetKeyStroke(char keyChar)
static KeyStrokegetKeyStroke(char keyChar, boolean onKeyRelease)
static KeyStrokegetKeyStroke(Character keyChar, int modifiers)
static KeyStrokegetKeyStroke(int keyCode, int modifiers, boolean onKeyRelease)
static KeyStrokegetKeyStroke(int keyCode, int modifiers)
static KeyStrokegetKeyStroke(String str)
Returns the KeyStroke according to getAWTKeyStroke().
static KeyStrokegetKeyStrokeForEvent(KeyEvent event)

Method Detail

getKeyStroke

public static KeyStroke getKeyStroke(char keyChar)

getKeyStroke

public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease)

Deprecated: Use {@link #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)