- java.lang.Object
-
- java.awt.KeyboardFocusManager
-
- java.awt.DefaultKeyboardFocusManager
-
- javax.swing.FocusManager
-
- 实现的所有接口
-
KeyEventDispatcher
,KeyEventPostProcessor
- 已知直接子类:
-
DefaultFocusManager
public abstract class FocusManager extends DefaultKeyboardFocusManager
这个类已经被1.4焦点API淘汰了。 虽然客户端代码仍然可以使用此类,但强烈建议开发人员使用java.awt.KeyboardFocusManager
和java.awt.DefaultKeyboardFocusManager
。请参阅How to Use the Focus Subsystem ,在Java教程一节,并Focus Specification获取更多信息。
- 从以下版本开始:
- 1.2
- 另请参见:
- Focus Specification
-
-
字段汇总
字段 变量和类型 字段 描述 static String
FOCUS_MANAGER_CLASS_PROPERTY
该字段已过时,不鼓励使用它,因为其规范与1.4焦点API不兼容。
-
构造方法摘要
构造方法 构造器 描述 FocusManager()
-
方法摘要
所有方法 静态方法 具体的方法 弃用的方法 变量和类型 方法 描述 static void
disableSwingFocusManager()
已过时。截至1.4,由KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
取代static FocusManager
getCurrentManager()
返回调用线程上下文的当前KeyboardFocusManager
实例。static boolean
isFocusManagerEnabled()
已过时。截至1.4,由KeyboardFocusManager.getDefaultFocusTraversalPolicy()
取代static void
setCurrentManager(FocusManager aFocusManager)
为调用线程的上下文设置当前KeyboardFocusManager
实例。-
声明方法的类 java.awt.DefaultKeyboardFocusManager
dequeueKeyEvents, discardKeyEvents, dispatchEvent, dispatchKeyEvent, downFocusCycle, enqueueKeyEvents, focusNextComponent, focusPreviousComponent, postProcessKeyEvent, processKeyEvent, upFocusCycle
-
声明方法的类 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
-
-
-
-
字段详细信息
-
FOCUS_MANAGER_CLASS_PROPERTY
public static final String FOCUS_MANAGER_CLASS_PROPERTY
该字段已过时,不鼓励使用它,因为其规范与1.4焦点API不兼容。 当前的FocusManager不再是UI的属性。 客户端代码必须使用KeyboardFocusManager.getCurrentKeyboardFocusManager()
查询当前的FocusManager。 有关详细信息,请参阅焦点规范。
-
-
方法详细信息
-
getCurrentManager
public static FocusManager getCurrentManager()
返回调用线程上下文的当前KeyboardFocusManager
实例。- 结果
-
这个帖子的上下文是
KeyboardFocusManager
- 另请参见:
-
setCurrentManager(javax.swing.FocusManager)
-
setCurrentManager
public static void setCurrentManager(FocusManager aFocusManager) throws SecurityException
为调用线程的上下文设置当前KeyboardFocusManager
实例。 如果null
指定,那么当前KeyboardFocusManager
被替换的新实例DefaultKeyboardFocusManager
。如果安装了
SecurityManager
,则必须为调用线程授予AWTPermission
“replaceKeyboardFocusManager”以替换当前的KeyboardFocusManager
。 如果未授予此权限,则此方法将抛出SecurityException
,并且当前KeyboardFocusManager
将保持不变。- 参数
-
aFocusManager
- 此线程的上下文的新KeyboardFocusManager
- 异常
-
SecurityException
- 如果调用线程无权替换当前KeyboardFocusManager
- 另请参见:
-
getCurrentManager()
,DefaultKeyboardFocusManager
-
disableSwingFocusManager
@Deprecated public static void disableSwingFocusManager()
Deprecated.as of 1.4, replaced byKeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
将当前KeyboardFocusManager
的默认值FocusTraversalPolicy
为DefaultFocusTraversalPolicy
。
-
isFocusManagerEnabled
@Deprecated public static boolean isFocusManagerEnabled()
Deprecated.As of 1.4, replaced byKeyboardFocusManager.getDefaultFocusTraversalPolicy()
返回应用程序是否已调用disableSwingFocusManager()
。- 结果
-
true
如果启用了焦点管理器。 - 另请参见:
-
disableSwingFocusManager()
-
-