public abstract class FocusManager extends DefaultKeyboardFocusManager
java.awt.KeyboardFocusManager和java.awt.DefaultKeyboardFocusManager 。
请参阅How to Use the Focus Subsystem ,在Java教程一节,以及Focus Specification以获取更多信息。
| Modifier and Type | Field and Description |
|---|---|
static String |
FOCUS_MANAGER_CLASS_PROPERTY
该字段已过时,因为其规范与1.4焦点API不兼容,因此不鼓励使用该字段。
|
BACKWARD_TRAVERSAL_KEYS,
DOWN_CYCLE_TRAVERSAL_KEYS,
FORWARD_TRAVERSAL_KEYS,
UP_CYCLE_TRAVERSAL_KEYS
| Constructor and Description |
|---|
FocusManager()
|
| Modifier and Type | Method and Description |
|---|---|
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实例。
|
dequeueKeyEvents,
discardKeyEvents,
dispatchEvent,
dispatchKeyEvent,
downFocusCycle,
enqueueKeyEvents,
focusNextComponent,
focusPreviousComponent,
postProcessKeyEvent,
processKeyEvent,
upFocusCycle
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
public static final String FOCUS_MANAGER_CLASS_PROPERTY
KeyboardFocusManager.getCurrentKeyboardFocusManager()查询当前的KeyboardFocusManager.getCurrentKeyboardFocusManager() 。
有关详细信息,请参阅焦点规格。
public static FocusManager getCurrentManager()
KeyboardFocusManager实例。
KeyboardFocusManager
setCurrentManager(javax.swing.FocusManager)
public static void setCurrentManager(FocusManager aFocusManager) throws SecurityException
KeyboardFocusManager实例。
如果null null,则当前的KeyboardFocusManager被替换为新的实例DefaultKeyboardFocusManager 。
如果安装了一个SecurityManager ,则调用线程必须被授予AWTPermission “replaceKeyboardFocusManager”,以替换当前的KeyboardFocusManager 。
如果没有这个权限,这个方法会抛出一个SecurityException ,而当前的KeyboardFocusManager将不会改变。
aFocusManager - 这个线程的上下文的新的
KeyboardFocusManager
SecurityException -
如果调用线程没有权限替换当前的
KeyboardFocusManager
getCurrentManager() , DefaultKeyboardFocusManager
@Deprecated public static void disableSwingFocusManager()
KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)取代
KeyboardFocusManager的默认值
FocusTraversalPolicy为
DefaultFocusTraversalPolicy 。
@Deprecated public static boolean isFocusManagerEnabled()
KeyboardFocusManager.getDefaultFocusTraversalPolicy()
disableSwingFocusManager() 。