- java.lang.Object
-
- java.awt.KeyboardFocusManager
-
- java.awt.DefaultKeyboardFocusManager
-
- javax.swing.FocusManager
-
- All Implemented Interfaces:
-
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
-
-
Field Summary
Fields Modifier and Type Field 描述 static String
FOCUS_MANAGER_CLASS_PROPERTY
该字段已过时,因为其规范与1.4焦点API不兼容,因此不鼓励使用该字段。-
Fields inherited from class java.awt.KeyboardFocusManager
BACKWARD_TRAVERSAL_KEYS, DOWN_CYCLE_TRAVERSAL_KEYS, FORWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS
-
-
构造方法摘要
构造方法 Constructor 描述 FocusManager()
-
方法摘要
所有方法 静态方法 具体的方法 弃用的方法 Modifier and Type 方法 描述 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
实例。-
Methods inherited from class java.awt.DefaultKeyboardFocusManager
dequeueKeyEvents, discardKeyEvents, dispatchEvent, dispatchKeyEvent, downFocusCycle, enqueueKeyEvents, focusNextComponent, focusPreviousComponent, postProcessKeyEvent, processKeyEvent, upFocusCycle
-
Methods inherited from 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
-
-
-
-
字段详细信息
-
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()
已过时。 截至1.4,由KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)
取代将当前KeyboardFocusManager
的默认值更改为FocusTraversalPolicy
至DefaultFocusTraversalPolicy
。
-
isFocusManagerEnabled
@Deprecated public static boolean isFocusManagerEnabled()
已过时。 截至1.4,由KeyboardFocusManager.getDefaultFocusTraversalPolicy()
替代返回应用程序是否调用了disableSwingFocusManager()
。- 结果
-
true
如果启用了焦点管理器。 - 另请参见:
-
disableSwingFocusManager()
-
-