所有类
javax.swing
类 FocusManager
java.lang.Object
java.awt.KeyboardFocusManager
java.awt.DefaultKeyboardFocusManager
javax.swing.FocusManager
-
所有已实现的接口:
-
KeyEventDispatcher, KeyEventPostProcessor
-
直接已知子类:
-
DefaultFocusManager
-
public abstract class FocusManager
- extends DefaultKeyboardFocusManager
从 1.4 focus API 开始,此类已被废弃。虽然客户机代码可能仍然使用此类,但强烈建议开发人员使用 java.awt.KeyboardFocusManager
和 java.awt.DefaultKeyboardFocusManager
替代。
有关更多信息,请参阅《The Java Tutorial》中的 How to Use the Focus Subsystem 一节和 Focus Specification。
-
另请参见:
-
Focus Specification
从类 java.awt.DefaultKeyboardFocusManager 继承的方法 |
dequeueKeyEvents, discardKeyEvents, dispatchEvent, dispatchKeyEvent, downFocusCycle, enqueueKeyEvents, focusNextComponent, focusPreviousComponent, postProcessKeyEvent, processKeyEvent, upFocusCycle |
从类 java.awt.KeyboardFocusManager 继承的方法 |
addKeyEventDispatcher, addKeyEventPostProcessor, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, 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 |
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FOCUS_MANAGER_CLASS_PROPERTY
public static final String FOCUS_MANAGER_CLASS_PROPERTY
-
该字段已被废弃,不鼓励使用它,因为它的规范与 1.4 focus API 不兼容。当前的 FocusManager 已经不再是 UI 的一个属性。客户端代码必须使用
KeyboardFocusManager.getCurrentKeyboardFocusManager()
来查询当前的 FocusManager。有关更多信息,请参阅 Focus Specification。
-
另请参见:
-
KeyboardFocusManager.getCurrentKeyboardFocusManager()
, Focus Specification, 常量字段值
FocusManager
public FocusManager()
getCurrentManager
public static FocusManager getCurrentManager()
-
返回调用线程上下文的当前
KeyboardFocusManager
实例。
-
-
返回:
-
此线程上下文的
KeyboardFocusManager
-
另请参见:
-
setCurrentManager(javax.swing.FocusManager)
setCurrentManager
public static void setCurrentManager(FocusManager aFocusManager)
throws SecurityException
-
设置调用线程上下文的当前
KeyboardFocusManager
实例。如果指定了 null
,则使用 DefaultKeyboardFocusManager
的新实例替换当前的 KeyboardFocusManager
。
如果安装了 SecurityManager
,则必须授予调用线程 AWTPermission
"replaceKeyboardFocusManager" 权限才能替换当前的 KeyboardFocusManager
。如果未授予该权限,则此方法将抛出 SecurityException
,而当前的 KeyboardFocusManager
不会改变。
-
-
参数:
-
aFocusManager
- 此线程上下文的新 KeyboardFocusManager
-
抛出:
-
SecurityException
- 如果调用线程没有替换当前 KeyboardFocusManager
的权限
-
另请参见:
-
getCurrentManager()
, DefaultKeyboardFocusManager
disableSwingFocusManager
@Deprecated
public static void disableSwingFocusManager()
-
已过时。 从 1.4 开始,由
KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
取代
-
将当前
KeyboardFocusManager
的默认 FocusTraversalPolicy
更改为 DefaultFocusTraversalPolicy
。
-
-
另请参见:
-
DefaultFocusTraversalPolicy
, KeyboardFocusManager.setDefaultFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
isFocusManagerEnabled
@Deprecated
public static boolean isFocusManagerEnabled()
-
已过时。 从 1.4 开始,由
KeyboardFocusManager.getDefaultFocusTraversalPolicy()
取代
-
返回应用程序是否已调用
disableSwingFocusManager()
。
-
-
另请参见:
-
disableSwingFocusManager()
所有类