public class DefaultFocusTraversalPolicy extends ContainerOrderFocusTraversalPolicy
Container.getComponents()
。那是不可见的和显示的层次结构的部分将不搜索。
如果客户端代码已明确由压倒一切的Component.isFocusTraversable()
或Component.isFocusable()
套组件的集中度,或致电Component.setFocusable()
,然后defaultfocustraversalpolicy表现完全一样的containerorderfocustraversalpolicy。如果,然而,部分依靠的是默认的集中度,那么DefaultFocusTraversalPolicy将拒绝所有组件与非可同行。这是所有AWT容器的默认FocusTraversalPolicy。
一个节点的集中度是依赖于实现的。太阳的建议,对于一个特定的本地平台所有的实现构建了同行的集中度。建议为Windows和Unix是画布、标签、面板、滚动条、scrollpanes,Windows,和轻量级组件不可同行,和所有其他组件也可同行。这些建议是用于太阳AWT的实现。注意,一个组件的节点的集中度是不同的,并没有影响,对构件本身的集中度。
请看 How to Use the Focus Subsystem,java教程中的一部分,和更多的信息Focus Specification。
Container.getComponents()
,
Component.isFocusable()
,
Component.setFocusable(boolean)
,
Serialized Form
Constructor and Description |
---|
DefaultFocusTraversalPolicy() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(Component aComponent)
确定一个组件是否是新的焦点所有者的可接受的选择。
|
getComponentAfter, getComponentBefore, getDefaultComponent, getFirstComponent, getImplicitDownCycleTraversal, getLastComponent, setImplicitDownCycleTraversal
getInitialComponent
protected boolean accept(Component aComponent)
Component.isFocusTraversable()
或
Component.isFocusable()
设置组件的集中度,或致电
Component.setFocusable()
,然后组件将当且仅当它是可接受的。如果,然而,部分依靠的是默认的集中度,然后所有的画布、标签、面板、滚动条、scrollpanes,Windows,和轻量级的组件将被拒绝。
accept
方法重写,继承类
ContainerOrderFocusTraversalPolicy
aComponent
-组件的健身作为一个焦点所有者进行测试
true
符合上述要求;
false
否则
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.