public abstract class KeyboardFocusManager extends Object implements KeyEventDispatcher, KeyEventPostProcessor
KeyboardFocusManager
handles the focusing of
windows for receiving keyboard events. The manager handles
the dispatch of all FocusEvent
s and
KeyEvent
s, along with WindowEvent
s
relating to the focused window. Users can use the manager
to ascertain the current focus owner and fire events.
Component
that receives
key events. The focus owner is either the currently focused
window or a component within this window.
Frame
or Dialog
, and is either the currently focused
window or its owner.
KeyboardFocusManager
, as opposed to the global
manager maintained by applets which share the same context.
Each context is insulated from the others, and they don't interact.
The resulting behaviour, as with context division, depends on the browser
supporting the applets. Regardless, there can only ever be
one focused window, one active window and one focus owner
per ClassLoader
.
ThreadGroup
to which it pertains. With respect to
applets, each code base has its own ThreadGroup
, so the
isolation of each context is enforced within the manager.
KEY_PRESSED
event.
However, all other key events related to the use of the
defined focus traversal key sequence are consumed and not
dispatched.
Modifier and Type | Field and Description |
---|---|
static int |
BACKWARD_TRAVERSAL_KEYS
Identifies
AWTKeyStroke s that move the focus backward in
the focus cycle. |
static int |
DOWN_CYCLE_TRAVERSAL_KEYS
Identifies
AWTKeyStroke s that move the focus down to the
child focus cycle root. |
static int |
FORWARD_TRAVERSAL_KEYS
Identifies
AWTKeyStroke s that move the focus forward in
the focus cycle. |
static int |
UP_CYCLE_TRAVERSAL_KEYS
Identifies
AWTKeyStroke s that move the focus up to the
parent focus cycle root. |
Constructor and Description |
---|
KeyboardFocusManager()
Construct a KeyboardFocusManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyEventDispatcher(KeyEventDispatcher dispatcher)
Adds a key event dispatcher to the list of registered dispatchers.
|
void |
addKeyEventPostProcessor(KeyEventPostProcessor postProcessor)
Adds a key event post processor to the list of registered post processors.
|
void |
addPropertyChangeListener(PropertyChangeListener l)
Registers the supplied property change listener for receiving
events caused by the following property changes:
the current focus owner ("focusOwner")
the permanent focus owner ("permanentFocusOwner")
the focused window ("focusedWindow")
the active window ("activeWindow")
the default focus traversal policy ("defaultFocusTraversalPolicy")
the default set of forward traversal keys ("forwardDefaultFocusTraversalKeys")
the default set of backward traversal keys ("backwardDefaultFocusTraversalKeys")
the default set of up cycle traversal keys ("upCycleDefaultFocusTraversalKeys")
the default set of down cycle traversal keys ("downCycleDefaultFocusTraversalKeys")
the current focus cycle root ("currentFocusCycleRoot")
If the supplied listener is null, nothing occurs.
|
void |
addPropertyChangeListener(String name,
PropertyChangeListener l)
Registers a property change listener for receiving events relating
to a change to a specified property.
|
void |
addVetoableChangeListener(String name,
VetoableChangeListener l)
Registers a vetoable property change listener for receiving events relating
to a vetoable change to a specified property.
|
void |
addVetoableChangeListener(VetoableChangeListener l)
Registers a vetoable property change listener for receiving events
relating to the following properties:
the current focus owner ("focusOwner")
the permanent focus owner ("permanentFocusOwner")
the focused window ("focusedWindow")
the active window ("activeWindow")
Nothing occurs if a null listener is supplied.
|
void |
clearGlobalFocusOwner()
Clear the global focus owner and deliver a FOCUS_LOST event to
the previously-focused
Component . |
protected abstract void |
dequeueKeyEvents(long after,
Component untilFocused)
Removes the key event block specified by the supplied timestamp and component.
|
protected abstract void |
discardKeyEvents(Component comp)
Discards all key event blocks relating to focus requirements for
the supplied component, regardless of timestamp.
|
abstract boolean |
dispatchEvent(AWTEvent e)
The AWT event dispatcher uses this method to request that the manager
handle a particular event.
|
abstract boolean |
dispatchKeyEvent(KeyEvent e)
Attempts to dispatch key events for which no key event dispatcher
has so far succeeded.
|
void |
downFocusCycle()
Moves the current focus downwards by one focus cycle,
iff the current focus cycle root is a
Container . |
abstract void |
downFocusCycle(Container cont)
Moves the current focus downwards by one focus cycle.
|
protected abstract void |
enqueueKeyEvents(long after,
Component untilFocused)
Delays all key events following the specified timestamp until the
supplied component has focus.
|
protected void |
firePropertyChange(String name,
Object o,
Object n)
Fires a property change event as a response to a change to
to the specified property.
|
protected void |
fireVetoableChange(String name,
Object o,
Object n)
Fires a property change event as a response to a vetoable change to
to the specified property.
|
void |
focusNextComponent()
Moves the current focus to the next component, based on the
current focus traversal policy.
|
abstract void |
focusNextComponent(Component comp)
Moves the current focus to the next component following
comp, based on the current focus traversal policy.
|
void |
focusPreviousComponent()
Moves the current focus to the previous component, based on the
current focus traversal policy.
|
abstract void |
focusPreviousComponent(Component comp)
Moves the current focus to the previous component, prior to
comp, based on the current focus traversal policy.
|
Window |
getActiveWindow()
Retrieve the active
Window , or null if the active window
was not set by a thread in the current ThreadGroup . |
Container |
getCurrentFocusCycleRoot()
Retrieve the current focus cycle root, or null if the focus owner
was not set by a thread in the current
ThreadGroup . |
static KeyboardFocusManager |
getCurrentKeyboardFocusManager()
Retrieve the keyboard focus manager associated with the
ThreadGroup to which the calling thread belongs. |
Set<AWTKeyStroke> |
getDefaultFocusTraversalKeys(int id)
Retrieve the default
Set of focus traversal
keys for one of the focus traversal directions. |
FocusTraversalPolicy |
getDefaultFocusTraversalPolicy()
Retrieve the default
FocusTraversalPolicy . |
Window |
getFocusedWindow()
Retrieve the
Window that is or contains the keyboard
focus owner, or null if the focused window was not set by a
thread in the current ThreadGroup . |
Component |
getFocusOwner()
Retrieve the
Component that has the keyboard focus, or
null if the focus owner was not set by a thread in the current
ThreadGroup . |
protected Window |
getGlobalActiveWindow()
Retrieve the active
Window , regardless of whether or not
the Window was made active by a thread in the current
ThreadGroup . |
protected Container |
getGlobalCurrentFocusCycleRoot()
Retrieve the current focus cycle root, regardless of whether or
not it was made set by a thread in the current
ThreadGroup . |
protected Window |
getGlobalFocusedWindow()
Retrieve the
Window that is or contains the focus owner,
regardless of whether or not the Window was set focused
by a thread in the current ThreadGroup . |
protected Component |
getGlobalFocusOwner()
Retrieve the
Component that has the keyboard focus,
regardless of whether or not it was set by a thread in the
current ThreadGroup . |
protected Component |
getGlobalPermanentFocusOwner()
Retrieve the
Component that has the permanent keyboard
focus, regardless of whether or not it was set by a thread in the
current ThreadGroup . |
protected List<KeyEventDispatcher> |
getKeyEventDispatchers()
Returns the currently registered key event dispatchers in
List
form. |
protected List<KeyEventPostProcessor> |
getKeyEventPostProcessors()
Returns the currently registered key event post processors in
List
form. |
Component |
getPermanentFocusOwner()
Retrieve the
Component that has the permanent keyboard
focus, or null if the focus owner was not set by a thread in the
current ThreadGroup . |
PropertyChangeListener[] |
getPropertyChangeListeners()
Returns the currently registered property change listeners
in array form.
|
PropertyChangeListener[] |
getPropertyChangeListeners(String name)
Returns the currently registered property change listeners
in array form, which listen for changes to the supplied property.
|
VetoableChangeListener[] |
getVetoableChangeListeners()
Returns the currently registered vetoable property change listeners
in array form.
|
VetoableChangeListener[] |
getVetoableChangeListeners(String name)
Returns the currently registered vetoable property change listeners
in array form, which listen for changes to the supplied property.
|
abstract boolean |
postProcessKeyEvent(KeyEvent e)
Handles the post processing of key events.
|
abstract void |
processKeyEvent(Component focused,
KeyEvent e)
Handles focus traversal operations for key events which
represent focus traversal keys in relation to the supplied
component.
|
void |
redispatchEvent(Component target,
AWTEvent e)
Handles redispatching of an event so that recursion of
dispatch requests does not occur.
|
void |
removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
Removes the specified key event dispatcher from the list of
registered dispatchers.
|
void |
removeKeyEventPostProcessor(KeyEventPostProcessor postProcessor)
Removes the specified key event post processor from the list of
registered post processors.
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes the supplied property change listener from the list
of registered listeners.
|
void |
removePropertyChangeListener(String name,
PropertyChangeListener l)
Removes the supplied property change listener registered for the
specified property from the list of registered listeners.
|
void |
removeVetoableChangeListener(String name,
VetoableChangeListener l)
Removes the supplied vetoable property change listener registered
for the specified property from the list of registered listeners.
|
void |
removeVetoableChangeListener(VetoableChangeListener l)
Removes the supplied vetoable property change listener from
the list of registered listeners.
|
static void |
setCurrentKeyboardFocusManager(KeyboardFocusManager m)
Set the keyboard focus manager associated with the
ThreadGroup to which the calling thread belongs. |
void |
setDefaultFocusTraversalKeys(int id,
Set<? extends AWTKeyStroke> keystrokes)
Set the default
Set of focus traversal keys for
one of the focus traversal directions. |
void |
setDefaultFocusTraversalPolicy(FocusTraversalPolicy policy)
Set the
FocusTraversalPolicy returned by getDefaultFocusTraversalPolicy() . |
protected void |
setGlobalActiveWindow(Window window)
Set the
Window that will be returned by getActiveWindow() (when it is called from the current ThreadGroup ) and getGlobalActiveWindow() . |
void |
setGlobalCurrentFocusCycleRoot(Container cycleRoot)
Set the
Container that will be returned by getCurrentFocusCycleRoot() (when it is called from the current
ThreadGroup ) and getGlobalCurrentFocusCycleRoot() . |
protected void |
setGlobalFocusedWindow(Window window)
Set the
Window that will be returned by getFocusedWindow() (when it is called from the current ThreadGroup ) and getGlobalFocusedWindow() . |
protected void |
setGlobalFocusOwner(Component owner)
Set the
Component that will be returned by getFocusOwner() (when it is called from the current ThreadGroup ) and getGlobalFocusOwner() . |
protected void |
setGlobalPermanentFocusOwner(Component focusOwner)
Set the
Component that will be returned by getPermanentFocusOwner() (when it is called from the current
ThreadGroup ) and getGlobalPermanentFocusOwner() . |
void |
upFocusCycle()
Moves the current focus upwards by one focus cycle,
so that the new focus owner is the focus cycle root
of the current owner.
|
abstract void |
upFocusCycle(Component comp)
Moves the current focus upwards by one focus cycle.
|
public static final int FORWARD_TRAVERSAL_KEYS
AWTKeyStroke
s that move the focus forward in
the focus cycle.public static final int BACKWARD_TRAVERSAL_KEYS
AWTKeyStroke
s that move the focus backward in
the focus cycle.public static final int UP_CYCLE_TRAVERSAL_KEYS
AWTKeyStroke
s that move the focus up to the
parent focus cycle root.public static final int DOWN_CYCLE_TRAVERSAL_KEYS
AWTKeyStroke
s that move the focus down to the
child focus cycle root.public KeyboardFocusManager()
public static KeyboardFocusManager getCurrentKeyboardFocusManager()
ThreadGroup
to which the calling thread belongs.public static void setCurrentKeyboardFocusManager(KeyboardFocusManager m)
ThreadGroup
to which the calling thread belongs.m
- the keyboard focus manager for the current thread grouppublic Component getFocusOwner()
Component
that has the keyboard focus, or
null if the focus owner was not set by a thread in the current
ThreadGroup
.protected Component getGlobalFocusOwner()
Component
that has the keyboard focus,
regardless of whether or not it was set by a thread in the
current ThreadGroup
. If there is no temporary
focus owner in effect then this method will return the same value
as getGlobalPermanentFocusOwner()
.SecurityException
- if this is not the keyboard focus
manager associated with the current ThreadGroup
protected void setGlobalFocusOwner(Component owner)
Component
that will be returned by getFocusOwner()
(when it is called from the current ThreadGroup
) and getGlobalFocusOwner()
. This
method does not actually transfer the keyboard focus.owner
- the Component to return from getFocusOwner and
getGlobalFocusOwnerComponent.requestFocus()
,
Component.requestFocusInWindow()
public void clearGlobalFocusOwner()
public Component getPermanentFocusOwner()
Component
that has the permanent keyboard
focus, or null if the focus owner was not set by a thread in the
current ThreadGroup
.protected Component getGlobalPermanentFocusOwner()
Component
that has the permanent keyboard
focus, regardless of whether or not it was set by a thread in the
current ThreadGroup
.SecurityException
- if this is not the keyboard focus
manager associated with the current ThreadGroup
protected void setGlobalPermanentFocusOwner(Component focusOwner)
Component
that will be returned by getPermanentFocusOwner()
(when it is called from the current
ThreadGroup
) and getGlobalPermanentFocusOwner()
. This method does not actually
transfer the keyboard focus.focusOwner
- the Component to return from
getPermanentFocusOwner and getGlobalPermanentFocusOwnerComponent.requestFocus()
,
Component.requestFocusInWindow()
public Window getFocusedWindow()
Window
that is or contains the keyboard
focus owner, or null if the focused window was not set by a
thread in the current ThreadGroup
.protected Window getGlobalFocusedWindow()
Window
that is or contains the focus owner,
regardless of whether or not the Window
was set focused
by a thread in the current ThreadGroup
.SecurityException
- if this is not the keyboard focus
manager associated with the current ThreadGroup
protected void setGlobalFocusedWindow(Window window)
Window
that will be returned by getFocusedWindow()
(when it is called from the current ThreadGroup
) and getGlobalFocusedWindow()
.
This method does not actually cause window
to become
the focused Window
.window
- the Window to return from getFocusedWindow and
getGlobalFocusedWindowpublic Window getActiveWindow()
Window
, or null if the active window
was not set by a thread in the current ThreadGroup
.protected Window getGlobalActiveWindow()
Window
, regardless of whether or not
the Window
was made active by a thread in the current
ThreadGroup
.SecurityException
- if this is not the keyboard focus
manager associated with the current ThreadGroup
protected void setGlobalActiveWindow(Window window)
Window
that will be returned by getActiveWindow()
(when it is called from the current ThreadGroup
) and getGlobalActiveWindow()
. This
method does not actually cause window
to be made
active.window
- the Window to return from getActiveWindow and
getGlobalActiveWindowpublic FocusTraversalPolicy getDefaultFocusTraversalPolicy()
FocusTraversalPolicy
.
Focus-managing Container
s use the returned object to
define their initial focus traversal policy.public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy policy)
FocusTraversalPolicy
returned by getDefaultFocusTraversalPolicy()
. Focus-managing Container
s created after this call will use policy as their
initial focus traversal policy. Existing Container
s'
focus traversal policies will not be affected by calls to this
method.policy
- the FocusTraversalPolicy that will be returned by
subsequent calls to getDefaultFocusTraversalPolicyIllegalArgumentException
- if policy is nullpublic void setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
Set
of focus traversal keys for
one of the focus traversal directions.id
- focus traversal direction identifierkeystrokes
- set of AWTKeyStrokesFORWARD_TRAVERSAL_KEYS
,
BACKWARD_TRAVERSAL_KEYS
,
UP_CYCLE_TRAVERSAL_KEYS
,
DOWN_CYCLE_TRAVERSAL_KEYS
public Set<AWTKeyStroke> getDefaultFocusTraversalKeys(int id)
Set
of focus traversal
keys for one of the focus traversal directions.id
- focus traversal direction identifierFORWARD_TRAVERSAL_KEYS
,
BACKWARD_TRAVERSAL_KEYS
,
UP_CYCLE_TRAVERSAL_KEYS
,
DOWN_CYCLE_TRAVERSAL_KEYS
public Container getCurrentFocusCycleRoot()
ThreadGroup
.protected Container getGlobalCurrentFocusCycleRoot()
ThreadGroup
.SecurityException
- if this is not the keyboard focus
manager associated with the current ThreadGroup
public void setGlobalCurrentFocusCycleRoot(Container cycleRoot)
Container
that will be returned by getCurrentFocusCycleRoot()
(when it is called from the current
ThreadGroup
) and getGlobalCurrentFocusCycleRoot()
. This method does not actually
make cycleRoot
the current focus cycle root.cycleRoot
- the focus cycle root to return from
getCurrentFocusCycleRoot and getGlobalCurrentFocusCycleRootpublic void addPropertyChangeListener(PropertyChangeListener l)
l
- the new listener to register.addPropertyChangeListener(String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener l)
l
- the listener to remove.public PropertyChangeListener[] getPropertyChangeListeners()
public void addPropertyChangeListener(String name, PropertyChangeListener l)
name
- the name of the property to handle change events for.l
- the listener to register for changes to the specified property.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String name, PropertyChangeListener l)
name
- the name of the property the listener is
monitoring changes to.l
- the listener to remove.public PropertyChangeListener[] getPropertyChangeListeners(String name)
name
- The property the returned listeners monitor for changes.protected void firePropertyChange(String name, Object o, Object n)
name
- The name of the property to which a change occurred.o
- The old value of the property.n
- The new value of the property.public void addVetoableChangeListener(VetoableChangeListener l)
l
- the listener to register.addVetoableChangeListener(String, java.beans.VetoableChangeListener)
public void removeVetoableChangeListener(VetoableChangeListener l)
l
- the listener to remove.public VetoableChangeListener[] getVetoableChangeListeners()
public void addVetoableChangeListener(String name, VetoableChangeListener l)
name
- the name of the property to handle change events for.l
- the listener to register for changes to the specified property.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void removeVetoableChangeListener(String name, VetoableChangeListener l)
name
- the name of the vetoable property the listener is
monitoring changes to.l
- the listener to remove.public VetoableChangeListener[] getVetoableChangeListeners(String name)
name
- The property the returned listeners monitor for changes.protected void fireVetoableChange(String name, Object o, Object n) throws PropertyVetoException
PropertyVetoException
to
the proposed change.
PropertyVetoException
in response to the reversion.
name
- The name of the property to which a change occurred.o
- The old value of the property.n
- The new value of the property.PropertyVetoException
- if one of the listeners vetos
the change by throwing this exception.public void addKeyEventDispatcher(KeyEventDispatcher dispatcher)
dispatchKeyEvent
method is called in the order that they were added, prior to the manager
dispatching the event itself. Notifications halt when one of the
dispatchers returns true.
dispatcher
- The dispatcher to register.public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
dispatcher
- The dispatcher to remove.protected List<KeyEventDispatcher> getKeyEventDispatchers()
List
form. At present, this only includes dispatchers explicitly registered
via the addKeyEventDispatcher()
method, but this behaviour
is subject to change and should not be depended on. The manager itself
may be a member of the list, but only if explicitly registered. If no
dispatchers have been registered, the list will be empty.addKeyEventDispatcher(java.awt.KeyEventDispatcher)
public void addKeyEventPostProcessor(KeyEventPostProcessor postProcessor)
postProcessKeyEvent
method is called to see if any post processing needs to be performed. THe
processors are called in the order in which they were added to the list,
and notifications continue until one returns true. As with key event
dispatchers, the manager is implicitly called following this process,
regardless of whether or not it is present within the list.
postProcessor
- the post processor to register.addKeyEventDispatcher(java.awt.KeyEventDispatcher)
public void removeKeyEventPostProcessor(KeyEventPostProcessor postProcessor)
postProcessor
- the post processor to remove.protected List<KeyEventPostProcessor> getKeyEventPostProcessors()
List
form. At present, this only includes post processors explicitly registered
via the addKeyEventPostProcessor()
method, but this behaviour
is subject to change and should not be depended on. The manager itself
may be a member of the list, but only if explicitly registered. If no
post processors have been registered, the list will be empty.addKeyEventPostProcessor(java.awt.KeyEventPostProcessor)
public abstract boolean dispatchEvent(AWTEvent e)
FocusEvent
s
and KeyEvent
s, and WindowEvent
s
relating to the focus. Dispatch is done with regard to the
the focus owner and the currently focused and active windows.
In handling the event, the source of the event may be overridden.
redispatchEvent()
. This avoids the infinite recursion
of dispatch requests which may occur if this method is called on
the target component.e
- the event to dispatch.redispatchEvent(java.awt.Component, java.awt.AWTEvent)
,
KeyEvent
,
FocusEvent
,
WindowEvent
public final void redispatchEvent(Component target, AWTEvent e)
dispatchEvent()
) and
the key event dispatchers should use this method to handle
dispatching rather than the dispatch method of the target
component.
target
- the target component to which the event is
dispatched.e
- the event to dispatch.public abstract boolean dispatchKeyEvent(KeyEvent e)
dispatchEvent()
following the sending of the key
event to any registered key event dispatchers. If the key
event reaches this stage, none of the dispatchers returned
true. This is, of course, always the case if there are no
registered dispatchers.
dispatchEvent()
, the calling method may try
to handle the event itself or simply forward on the
false result to its caller. When the event is dispatched
by this method, a true result is propogated through the
calling methods.dispatchKeyEvent
in interface KeyEventDispatcher
e
- the key event to dispatch.redispatchEvent(Component, AWTEvent)
public abstract boolean postProcessKeyEvent(KeyEvent e)
MenuShortcut
s. The event is consumed
in the process and the shortcut is activated. This
method is usually called by dispatchKeyEvent
.postProcessKeyEvent
in interface KeyEventPostProcessor
e
- the key event to post process.redispatchEvent(Component, AWTEvent)
public abstract void processKeyEvent(Component focused, KeyEvent e)
focused
- the component on which to perform focus traversal,
on the assumption that this component has the focus.e
- the possible focus traversal key event.protected abstract void enqueueKeyEvents(long after, Component untilFocused)
FOCUS_GAINED
event is received
for the untilFocused component. The manager is responsible for ensuring
this takes place.after
- the timestamp beyond which all key events are delayed until
the supplied component gains focus.untilFocused
- the component to wait on gaining focus.protected abstract void dequeueKeyEvents(long after, Component untilFocused)
after
- the timestamp of the key event block to be removed, or a
value smaller than 0 if the oldest is to be removed.untilFocused
- the component of the key event block to be removed.protected abstract void discardKeyEvents(Component comp)
comp
- the component of the key event block(s) to be removed.public abstract void focusNextComponent(Component comp)
Canvas
es, Panel
s,
Label
s, ScrollPane
s, Scrollbar
s,
Window
s and lightweight components are judged
to be unacceptable by default. See the
DefaultFocusTraversalPolicy
for more details.comp
- the component prior to the one which will
become the focus, following execution of this method.DefaultFocusTraversalPolicy
public abstract void focusPreviousComponent(Component comp)
Canvas
es, Panel
s,
Label
s, ScrollPane
s, Scrollbar
s,
Window
s and lightweight components are judged
to be unacceptable by default. See the
DefaultFocusTraversalPolicy
for more details.comp
- the component following the one which will
become the focus, following execution of this method.DefaultFocusTraversalPolicy
public abstract void upFocusCycle(Component comp)
Window
, the default
focus component becomes the focus owner and the focus cycle
root is not changed.comp
- the component used as part of the focus traversal.public abstract void downFocusCycle(Container cont)
cont
- the container used as part of the focus traversal.public final void focusNextComponent()
Canvas
es, Panel
s,
Label
s, ScrollPane
s, Scrollbar
s,
Window
s and lightweight components are judged
to be unacceptable by default. See the
DefaultFocusTraversalPolicy
for more details.DefaultFocusTraversalPolicy
public final void focusPreviousComponent()
Canvas
es, Panel
s,
Label
s, ScrollPane
s, Scrollbar
s,
Window
s and lightweight components are judged
to be unacceptable by default. See the
DefaultFocusTraversalPolicy
for more details.DefaultFocusTraversalPolicy
public final void upFocusCycle()
Window
, the default
component of this window becomes the focus owner and the
focus cycle root is not changed.public final void downFocusCycle()
Container
.
Usually, the new focus owner is set to the default component
of the container and the current focus cycle root is set
to the current focus owner. Nothing occurs if the current
focus cycle root is not a container.