java.lang.Object
java.awt.KeyboardFocusManager
java.awt.DefaultKeyboardFocusManager
- All Implemented Interfaces:
KeyEventDispatcher
,KeyEventPostProcessor
- Direct Known Subclasses:
FocusManager
The default KeyboardFocusManager for AWT applications. Focus traversal is
done in response to a Component's focus traversal keys, and using a
Container's FocusTraversalPolicy.
Please see How to Use the Focus Subsystem, a section in The Java Tutorial, and the Focus Specification for more information.
-
Field Summary
Fields declared in class java.awt.KeyboardFocusManager
BACKWARD_TRAVERSAL_KEYS, DOWN_CYCLE_TRAVERSAL_KEYS, FORWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
dequeueKeyEvents(long after, Component untilFocused)
Releases for normal dispatching to the current focus owner all KeyEvents which were enqueued because of a call toenqueueKeyEvents
with the same timestamp and Component.protected void
discardKeyEvents(Component comp)
Discards all KeyEvents which were enqueued because of one or more calls toenqueueKeyEvents
with the specified Component, or one of its descendants.boolean
This method is called by the AWT event dispatcher requesting that the current KeyboardFocusManager dispatch the specified event on its behalf.boolean
Called bydispatchEvent
if no other KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or if no other KeyEventDispatchers are registered.void
downFocusCycle(Container aContainer)
Moves the focus down one focus traversal cycle.protected void
enqueueKeyEvents(long after, Component untilFocused)
Delays dispatching of KeyEvents until the specified Component becomes the focus owner.void
focusNextComponent(Component aComponent)
Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.void
focusPreviousComponent(Component aComponent)
Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.boolean
This method will be called bydispatchKeyEvent
.void
processKeyEvent(Component focusedComponent, KeyEvent e)
This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent.void
upFocusCycle(Component aComponent)
Moves the focus up one focus traversal cycle.