API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. AWTKeyStroke View Source
Author(s)
Arnaud Weber
David Mendenhall
Since
1.4
Version
1.28, 02/06/06
Serial
Hierarchy
 Object
      AWTKeyStroke
Implements
 Serializable
Subclasses
Description
public class AWTKeyStroke
  An AWTKeyStroke represents a key action on the keyboard, or equivalent input device.
Constructors
protected AWTKeyStroke ()
  Constructs an AWTKeyStroke with default values.
protected AWTKeyStroke (char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
  Constructs an AWTKeyStroke with the specified values.
Methods
Hide/Show inherited methods
publicfinal boolean equals (Object anObject)
  Returns true if this object is identical to the specified object.
publicstatic AWTKeyStroke getAWTKeyStroke (char keyChar)
  Returns a shared instance of an AWTKeyStroke that represents a KEY_TYPED event for the specified character.
publicstatic AWTKeyStroke getAWTKeyStroke (Character keyChar, int modifiers)
  Returns a shared instance of an AWTKeyStroke that represents a KEY_TYPED event for the specified Character object and a set of modifiers.
publicstatic AWTKeyStroke getAWTKeyStroke (int keyCode, int modifiers)
  Returns a shared instance of an AWTKeyStroke, given a numeric key code and a set of modifiers.
publicstatic 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.
publicstatic AWTKeyStroke getAWTKeyStroke (String s)
  Parses a string and returns an AWTKeyStroke.
publicstatic AWTKeyStroke getAWTKeyStrokeForEvent (KeyEvent anEvent)
  Returns an AWTKeyStroke which represents the stroke which generated a given KeyEvent.
publicfinal char getKeyChar ()
  Returns the character for this AWTKeyStroke.
publicfinal int getKeyCode ()
  Returns the numeric key code for this AWTKeyStroke.
publicfinal int getKeyEventType ()
  Returns the type of KeyEvent which corresponds to this AWTKeyStroke.
publicfinal int getModifiers ()
  Returns the modifier keys for this AWTKeyStroke.
pack-privatestatic String getModifiersText (int modifiers)
pack-privatestatic String getVKText (int keyCode)
public int hashCode ()
  Returns a numeric value for this object that is likely to be unique, making it a good choice as the index value in a hash table.
publicfinal boolean isOnKeyRelease ()
  Returns whether this AWTKeyStroke represents a key release.
protected Object readResolve () throws ObjectStreamException
  Returns a cached instance of AWTKeyStroke (or a subclass of AWTKeyStroke) which is equal to this instance.
protectedstatic void registerSubclass (Class<Object> subclass)
  Registers a new class which the factory methods in AWTKeyStroke will use when generating new instances of AWTKeyStrokes.
public String toString ()
  Returns a string that displays and identifies this object's properties.
Fields
Hide/Show inherited fields
pack-privatefinalstatic long serialVersionUID = "-6430539691155161871"
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar