java.lang.Object
java.awt.KeyboardFocusManager
java.awt.DefaultKeyboardFocusManager
javax.swing.FocusManager
- 所有已实现的接口:
-
KeyEventDispatcher
,KeyEventPostProcessor
- 直接已知的子类:
-
DefaultFocusManager
该类已被1.4焦点API所废弃。虽然客户端代码仍可使用该类,但强烈建议开发人员改用
java.awt.KeyboardFocusManager
和java.awt.DefaultKeyboardFocusManager
。
- 自版本:
- 1.2
- 另请参见:
-
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
已过时。static FocusManager
返回调用线程上下文中当前的KeyboardFocusManager
实例。static boolean
已过时。从1.4开始,由KeyboardFocusManager.getDefaultFocusTraversalPolicy()
替代static void
setCurrentManager
(FocusManager aFocusManager) 设置调用线程上下文中当前的KeyboardFocusManager
实例。Methods declared in class java.awt.DefaultKeyboardFocusManager
dequeueKeyEvents, discardKeyEvents, dispatchEvent, dispatchKeyEvent, downFocusCycle, enqueueKeyEvents, focusNextComponent, focusPreviousComponent, postProcessKeyEvent, processKeyEvent, upFocusCycle
Methods declared in class java.awt.KeyboardFocusManager
addKeyEventDispatcher, addKeyEventPostProcessor, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clearFocusOwner, clearGlobalFocusOwner, downFocusCycle, firePropertyChange, fireVetoableChange, focusNextComponent, focusPreviousComponent, getActiveWindow, getCurrentFocusCycleRoot, getCurrentKeyboardFocusManager, getDefaultFocusTraversalKeys, getDefaultFocusTraversalPolicy, getFocusedWindow, getFocusOwner, getGlobalActiveWindow, getGlobalCurrentFocusCycleRoot, getGlobalFocusedWindow, getGlobalFocusOwner, getGlobalPermanentFocusOwner, getKeyEventDispatchers, getKeyEventPostProcessors, getPermanentFocusOwner, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, redispatchEvent, removeKeyEventDispatcher, removeKeyEventPostProcessor, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setCurrentKeyboardFocusManager, setDefaultFocusTraversalKeys, setDefaultFocusTraversalPolicy, setGlobalActiveWindow, setGlobalCurrentFocusCycleRoot, setGlobalFocusedWindow, setGlobalFocusOwner, setGlobalPermanentFocusOwner, upFocusCycle
-
Field Details
-
FOCUS_MANAGER_CLASS_PROPERTY
该字段已过时,不建议使用,因为其规范与1.4焦点API不兼容。当前的FocusManager不再是UI的属性。客户端代码必须使用KeyboardFocusManager.getCurrentKeyboardFocusManager()
查询当前的FocusManager。有关更多信息,请参阅焦点规范。- 另请参见:
-
-
Constructor Details
-
FocusManager
protected FocusManager()子类调用的构造函数。
-
-
Method Details
-
getCurrentManager
返回调用线程上下文中当前的KeyboardFocusManager
实例。- 返回:
-
该线程上下文的
KeyboardFocusManager
- 另请参见:
-
setCurrentManager
设置调用线程上下文中当前的KeyboardFocusManager
实例。如果指定null
,则当前的KeyboardFocusManager
将被替换为DefaultKeyboardFocusManager
的新实例。如果安装了
SecurityManager
,则调用线程必须被授予AWTPermission
"replaceKeyboardFocusManager"权限才能替换当前的KeyboardFocusManager
。如果未授予此权限,此方法将抛出SecurityException
,当前的KeyboardFocusManager
将保持不变。- 参数:
-
aFocusManager
- 该线程上下文的新KeyboardFocusManager
- 抛出:
-
SecurityException
- 如果调用线程没有权限替换当前的KeyboardFocusManager
- 另请参见:
-
disableSwingFocusManager
Deprecated.as of 1.4, replaced byKeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
将当前KeyboardFocusManager
的默认FocusTraversalPolicy
更改为DefaultFocusTraversalPolicy
。- 另请参见:
-
isFocusManagerEnabled
Deprecated.As of 1.4, replaced byKeyboardFocusManager.getDefaultFocusTraversalPolicy()
返回应用程序是否调用了disableSwingFocusManager()
。- 返回:
-
如果焦点管理器已启用,则返回
true
。 - 另请参见:
-
KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
替代