KeyStrokes are used to define high-level (semantic) action events. Instead of trapping every keystroke and throwing away the ones you are not interested in, those keystrokes you care about automatically initiate actions on the Components with which they are registered.
KeyStrokes are immutable, and are intended to be unique. Client code cannot create a KeyStroke; a variant of getKeyStroke
must be used instead. These factory methods allow the KeyStroke implementation to cache and share instances efficiently.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans
package. Please see {@link java.beans.XMLEncoder}.
@see javax.swing.text.Keymap
@see #getKeyStroke
@author Arnaud Weber
@author David Mendenhall
A KeyStroke
is defined as an optional set of modifier keys followed optionally by a natural key. A KeyStroke
is said to be complete if it contains a natural key. A natural key is any Unicode character (e.g., "backspace", etc.), any character belonging to a natural language (e.g., "A", "1", "[", etc.), or any special control character specific to computers (e.g., "F10", "PageUp", etc.).
All KeyStroke
objects have a formal string representation available via the toString()
method. There are a number of methods to get instances of KeyStroke
objects, including one which can parse this formal string representation.
All KeyStroke
objects, via the format()
method, provide a version of their formal string representation translated by platform and locale, suitable for display to a user.
KeyStroke
objects are immutable. Clients are not permitted to extend this class.
A KeyStroke
is defined as an optional set of modifier keys followed optionally by a natural key. A KeyStroke
is said to be complete if it contains a natural key. A natural key is any Unicode character (e.g., "backspace", etc.), any character belonging to a natural language (e.g., "A", "1", "[", etc.), or any special control character specific to computers (e.g., "F10", "PageUp", etc.).
All KeyStroke
objects have a formal string representation available via the toString()
method. There are a number of methods to get instances of KeyStroke
objects, including one which can parse this formal string representation.
All KeyStroke
objects, via the format()
method, provide a version of their formal string representation translated by platform and locale, suitable for display to a user.
KeyStroke
objects are immutable. Clients are not permitted to extend this class.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|