
should be a bitmask composed of the ALT_MASK, CTRL_MASK, META_MASK, and SHIFT_MASK
constants defined by java.awt.Event.
See also the registerKeyboardAction() method of JComponent, the setAccelerator() method of
JMenuItem, and javax.awt.swing .text.Keymap.
public class KeyStroke implements Serializable {
// No Constructor
// Public Class Methods
public static KeyStroke getKeyStroke(char keyChar);
public static KeyStroke getKeyStroke(String s);
public static KeyStroke getKeyStroke(int keyCode, int modifiers);
public static KeyStroke getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease);
public static KeyStroke getKeyStrokeForEvent(java.awt.e vent.Ke yEvent anEvent);
// Property Accessor Methods (by property name)
public char getKeyChar();
public int getKeyCode();
public int getModifiers();
public boolean isOnKeyRelease();
// Public Methods Overriding Object
public boolean equals(Object anObject);
public int hashCode();
public String toString();
// Deprecated Public Methods
# public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease);
}
Hierar chy: Object→ KeyStroke(Serializable)
Passed To: JComponent.{getActionForKeyStroke(), getConditionForKeyStroke(), registerKeyboardAction(),
unregisterKeyboardAction()}, JMenu.setAccelerator(), JMenuItem.setAccelerator(),
javax.swing .text.JTextComponent.KeyBinding.KeyBinding(), javax.swing .text.Keymap.{addActionForKeyStroke(),
getAction(), isLocallyDefined(), ...