Uses of Class
javax.swing.KeyStroke
Packages that use KeyStroke
Package
Description
Provides a set of "lightweight" (all-Java language) components
that, to the maximum degree possible, work the same on all platforms.
Provides user interface objects built according to the Basic look and feel.
Provides classes and interfaces that deal with editable and noneditable text
components.
-
Uses of KeyStroke in javax.swing
Methods in javax.swing that return KeyStrokeModifier and TypeMethodDescriptionInputMap.allKeys()Returns an array of theKeyStrokes defined in thisInputMapand its parent.JMenuItem.getAccelerator()Returns theKeyStrokewhich serves as an accelerator for the menu item.static KeyStrokeKeyStroke.getKeyStroke(char keyChar) Returns a shared instance of aKeyStrokethat represents aKEY_TYPEDevent for the specified character.static KeyStrokeKeyStroke.getKeyStroke(char keyChar, boolean onKeyRelease) Deprecated.use getKeyStroke(char)static KeyStrokeKeyStroke.getKeyStroke(int keyCode, int modifiers) Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers.static KeyStrokeKeyStroke.getKeyStroke(int keyCode, int modifiers, boolean onKeyRelease) Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers, specifying whether the key is activated when it is pressed or released.static KeyStrokeKeyStroke.getKeyStroke(Character keyChar, int modifiers) Returns a shared instance of aKeyStrokethat represents aKEY_TYPEDevent for the specified Character object and a set of modifiers.static KeyStrokeKeyStroke.getKeyStroke(String s) Parses a string and returns aKeyStroke.static KeyStrokeKeyStroke.getKeyStrokeForEvent(KeyEvent anEvent) Returns a KeyStroke which represents the stroke which generated a given KeyEvent.JComponent.getRegisteredKeyStrokes()Returns theKeyStrokesthat will initiate registered actions.InputMap.keys()Returns theKeyStrokes that are bound in thisInputMap.Methods in javax.swing with parameters of type KeyStrokeModifier and TypeMethodDescriptionReturns the binding forkeyStroke, messaging the parentInputMapif the binding is not locally defined.JComponent.getActionForKeyStroke(KeyStroke aKeyStroke) Returns the object that will perform the action registered for a given keystroke.intJComponent.getConditionForKeyStroke(KeyStroke aKeyStroke) Returns the condition that determines whether a registered action occurs in response to the specified keystroke.static booleanSwingUtilities.notifyAction(Action action, KeyStroke ks, KeyEvent event, Object sender, int modifiers) InvokesactionPerformedonactionifactionis non-nulland accepts the sender object.protected booleanJComponent.processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) Invoked to process the key bindings forksas the result of theKeyEvente.protected booleanJMenuBar.processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) Subclassed to check all the child menus.voidAdds a binding forkeyStroketoactionMapKey.voidAdds a binding forkeyStroketoactionMapKey.voidJComponent.registerKeyboardAction(ActionListener anAction, String aCommand, KeyStroke aKeyStroke, int aCondition) This method is now obsolete, please use a combination ofgetActionMap()andgetInputMap()for similar behavior.voidJComponent.registerKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition) This method is now obsolete, please use a combination ofgetActionMap()andgetInputMap()for similar behavior.voidRemoves the binding forkeyfrom this object.voidRemoves the binding forkeyfrom thisInputMap.voidJMenu.setAccelerator(KeyStroke keyStroke) setAcceleratoris not defined forJMenu.voidJMenuItem.setAccelerator(KeyStroke keyStroke) Sets the key combination which invokes the menu item's action listeners without navigating the menu hierarchy.voidJComponent.unregisterKeyboardAction(KeyStroke aKeyStroke) This method is now obsolete. -
Uses of KeyStroke in javax.swing.plaf.basic
Fields in javax.swing.plaf.basic declared as KeyStrokeModifier and TypeFieldDescriptionprotected KeyStrokeBasicDesktopPaneUI.closeKeyDeprecated.As of 1.3.protected KeyStrokeBasicSplitPaneUI.dividerResizeToggleKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicSplitPaneUI.downKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicTabbedPaneUI.downKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicToolBarUI.downKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicSplitPaneUI.endKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicSplitPaneUI.homeKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicSplitPaneUI.leftKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicTabbedPaneUI.leftKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicToolBarUI.leftKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicDesktopPaneUI.maximizeKeyDeprecated.As of 1.3.protected KeyStrokeBasicDesktopPaneUI.minimizeKeyDeprecated.As of 1.3.protected KeyStrokeBasicDesktopPaneUI.navigateKeyDeprecated.As of 1.3.protected KeyStrokeBasicDesktopPaneUI.navigateKey2Deprecated.As of 1.3.protected KeyStrokeBasicInternalFrameUI.openMenuKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicSplitPaneUI.rightKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicTabbedPaneUI.rightKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicToolBarUI.rightKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicSplitPaneUI.upKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicTabbedPaneUI.upKeyDeprecated.As of Java 2 platform v1.3.protected KeyStrokeBasicToolBarUI.upKeyDeprecated.As of Java 2 platform v1.3. -
Uses of KeyStroke in javax.swing.text
Fields in javax.swing.text declared as KeyStrokeMethods in javax.swing.text that return KeyStrokeModifier and TypeMethodDescriptionKeymap.getBoundKeyStrokes()Fetches all of the keystrokes in this map that are bound to some action.Keymap.getKeyStrokesForAction(Action a) Fetches the keystrokes that will result in the given action.Methods in javax.swing.text with parameters of type KeyStrokeModifier and TypeMethodDescriptionvoidKeymap.addActionForKeyStroke(KeyStroke key, Action a) Adds a binding to the keymap.Fetches the action appropriate for the given symbolic event sequence.booleanKeymap.isLocallyDefined(KeyStroke key) Determines if the given key sequence is locally defined.voidKeymap.removeKeyStrokeBinding(KeyStroke keys) Removes a binding from the keymap.Constructors in javax.swing.text with parameters of type KeyStrokeModifierConstructorDescriptionKeyBinding(KeyStroke key, String actionName) Creates a new key binding.