java.awt

Class DefaultFocusTraversalPolicy

public class DefaultFocusTraversalPolicy extends ContainerOrderFocusTraversalPolicy

DefaultFocusTraversalPolicy is the default focus traversal policy used by Containers. This policy sharpens ContainerOrderFocusTraversalPolicy's acceptance criteria, to reject those Components that have unfocusable peers. Despite this extra strictness, this policy will always accept a Component that has explicitly been set focusable by any means. This AWT implementation assumes that the peers of the following Components are not focusable: Canvas, Panel, Label, ScrollPane, Scrollbar, Window, and any lightweight Component. A Component's focusability is independent of the focusability of its peer.

Since: 1.4

Constructor Summary
DefaultFocusTraversalPolicy()
Construct a default focus traversal policy.
Method Summary
protected booleanaccept(Component comp)
Check whether a given Component would be acceptable as a focus owner.

Constructor Detail

DefaultFocusTraversalPolicy

public DefaultFocusTraversalPolicy()
Construct a default focus traversal policy.

Method Detail

accept

protected boolean accept(Component comp)
Check whether a given Component would be acceptable as a focus owner. The Component must be displayable, visible and enabled to be acceptable. If the Component's focus traversability has been overridden, by overriding Component.isFocusTraversable or Component.isFocusable, or by calling Component.setFocusable, then the Component will be accepted if it is focusable. If the Component uses the default focus traversable behaviour, then comp will always be rejected if it is a Canvas, Panel, Label, ScrollPane, Scrollbar, Window or lightweight Component.

Parameters: comp the Component to check

Returns: true if the Component is an acceptable target for keyboard input focus, false otherwise