FocusManager (Java SE 15 & JDK 15) (original) (raw)
All Implemented Interfaces:
[KeyEventDispatcher](../../java/awt/KeyEventDispatcher.html "interface in java.awt")
, [KeyEventPostProcessor](../../java/awt/KeyEventPostProcessor.html "interface in java.awt")
Direct Known Subclasses:
[DefaultFocusManager](DefaultFocusManager.html "class in javax.swing")
public abstract class FocusManager extends DefaultKeyboardFocusManager
This class has been obsoleted by the 1.4 focus APIs. While client code may still use this class, developers are strongly encouraged to usejava.awt.KeyboardFocusManager
andjava.awt.DefaultKeyboardFocusManager
instead.
Please see How to Use the Focus Subsystem, a section in The Java Tutorial, and theFocus Specification for more information.
Since:
1.2
See Also:
Field Summary
Fields
Modifier and Type | Field | Description |
---|---|---|
static String | FOCUS_MANAGER_CLASS_PROPERTY | This field is obsolete, and its use is discouraged since its specification is incompatible with the 1.4 focus APIs. |
Constructor Summary
Constructors
Constructor | Description |
---|---|
FocusManager() |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
static void | disableSwingFocusManager() | Deprecated. |
static FocusManager | getCurrentManager() | Returns the current KeyboardFocusManager instance for the calling thread's context. |
static boolean | isFocusManagerEnabled() | Deprecated. |
static void | setCurrentManager(FocusManager aFocusManager) | Sets the current KeyboardFocusManager instance for the calling thread's context. |
Methods declared in class java.awt.DefaultKeyboardFocusManager
[dequeueKeyEvents](../../java/awt/DefaultKeyboardFocusManager.html#dequeueKeyEvents%28long,java.awt.Component%29), [discardKeyEvents](../../java/awt/DefaultKeyboardFocusManager.html#discardKeyEvents%28java.awt.Component%29), [dispatchEvent](../../java/awt/DefaultKeyboardFocusManager.html#dispatchEvent%28java.awt.AWTEvent%29), [dispatchKeyEvent](../../java/awt/DefaultKeyboardFocusManager.html#dispatchKeyEvent%28java.awt.event.KeyEvent%29), [downFocusCycle](../../java/awt/DefaultKeyboardFocusManager.html#downFocusCycle%28java.awt.Container%29), [enqueueKeyEvents](../../java/awt/DefaultKeyboardFocusManager.html#enqueueKeyEvents%28long,java.awt.Component%29), [focusNextComponent](../../java/awt/DefaultKeyboardFocusManager.html#focusNextComponent%28java.awt.Component%29), [focusPreviousComponent](../../java/awt/DefaultKeyboardFocusManager.html#focusPreviousComponent%28java.awt.Component%29), [postProcessKeyEvent](../../java/awt/DefaultKeyboardFocusManager.html#postProcessKeyEvent%28java.awt.event.KeyEvent%29), [processKeyEvent](../../java/awt/DefaultKeyboardFocusManager.html#processKeyEvent%28java.awt.Component,java.awt.event.KeyEvent%29), [upFocusCycle](../../java/awt/DefaultKeyboardFocusManager.html#upFocusCycle%28java.awt.Component%29)
Methods declared in class java.awt.KeyboardFocusManager
[addKeyEventDispatcher](../../java/awt/KeyboardFocusManager.html#addKeyEventDispatcher%28java.awt.KeyEventDispatcher%29), [addKeyEventPostProcessor](../../java/awt/KeyboardFocusManager.html#addKeyEventPostProcessor%28java.awt.KeyEventPostProcessor%29), [addPropertyChangeListener](../../java/awt/KeyboardFocusManager.html#addPropertyChangeListener%28java.beans.PropertyChangeListener%29), [addPropertyChangeListener](../../java/awt/KeyboardFocusManager.html#addPropertyChangeListener%28java.lang.String,java.beans.PropertyChangeListener%29), [addVetoableChangeListener](../../java/awt/KeyboardFocusManager.html#addVetoableChangeListener%28java.beans.VetoableChangeListener%29), [addVetoableChangeListener](../../java/awt/KeyboardFocusManager.html#addVetoableChangeListener%28java.lang.String,java.beans.VetoableChangeListener%29), [clearFocusOwner](../../java/awt/KeyboardFocusManager.html#clearFocusOwner%28%29), [clearGlobalFocusOwner](../../java/awt/KeyboardFocusManager.html#clearGlobalFocusOwner%28%29), [downFocusCycle](../../java/awt/KeyboardFocusManager.html#downFocusCycle%28%29), [firePropertyChange](../../java/awt/KeyboardFocusManager.html#firePropertyChange%28java.lang.String,java.lang.Object,java.lang.Object%29), [fireVetoableChange](../../java/awt/KeyboardFocusManager.html#fireVetoableChange%28java.lang.String,java.lang.Object,java.lang.Object%29), [focusNextComponent](../../java/awt/KeyboardFocusManager.html#focusNextComponent%28%29), [focusPreviousComponent](../../java/awt/KeyboardFocusManager.html#focusPreviousComponent%28%29), [getActiveWindow](../../java/awt/KeyboardFocusManager.html#getActiveWindow%28%29), [getCurrentFocusCycleRoot](../../java/awt/KeyboardFocusManager.html#getCurrentFocusCycleRoot%28%29), [getCurrentKeyboardFocusManager](../../java/awt/KeyboardFocusManager.html#getCurrentKeyboardFocusManager%28%29), [getDefaultFocusTraversalKeys](../../java/awt/KeyboardFocusManager.html#getDefaultFocusTraversalKeys%28int%29), [getDefaultFocusTraversalPolicy](../../java/awt/KeyboardFocusManager.html#getDefaultFocusTraversalPolicy%28%29), [getFocusedWindow](../../java/awt/KeyboardFocusManager.html#getFocusedWindow%28%29), [getFocusOwner](../../java/awt/KeyboardFocusManager.html#getFocusOwner%28%29), [getGlobalActiveWindow](../../java/awt/KeyboardFocusManager.html#getGlobalActiveWindow%28%29), [getGlobalCurrentFocusCycleRoot](../../java/awt/KeyboardFocusManager.html#getGlobalCurrentFocusCycleRoot%28%29), [getGlobalFocusedWindow](../../java/awt/KeyboardFocusManager.html#getGlobalFocusedWindow%28%29), [getGlobalFocusOwner](../../java/awt/KeyboardFocusManager.html#getGlobalFocusOwner%28%29), [getGlobalPermanentFocusOwner](../../java/awt/KeyboardFocusManager.html#getGlobalPermanentFocusOwner%28%29), [getKeyEventDispatchers](../../java/awt/KeyboardFocusManager.html#getKeyEventDispatchers%28%29), [getKeyEventPostProcessors](../../java/awt/KeyboardFocusManager.html#getKeyEventPostProcessors%28%29), [getPermanentFocusOwner](../../java/awt/KeyboardFocusManager.html#getPermanentFocusOwner%28%29), [getPropertyChangeListeners](../../java/awt/KeyboardFocusManager.html#getPropertyChangeListeners%28%29), [getPropertyChangeListeners](../../java/awt/KeyboardFocusManager.html#getPropertyChangeListeners%28java.lang.String%29), [getVetoableChangeListeners](../../java/awt/KeyboardFocusManager.html#getVetoableChangeListeners%28%29), [getVetoableChangeListeners](../../java/awt/KeyboardFocusManager.html#getVetoableChangeListeners%28java.lang.String%29), [redispatchEvent](../../java/awt/KeyboardFocusManager.html#redispatchEvent%28java.awt.Component,java.awt.AWTEvent%29), [removeKeyEventDispatcher](../../java/awt/KeyboardFocusManager.html#removeKeyEventDispatcher%28java.awt.KeyEventDispatcher%29), [removeKeyEventPostProcessor](../../java/awt/KeyboardFocusManager.html#removeKeyEventPostProcessor%28java.awt.KeyEventPostProcessor%29), [removePropertyChangeListener](../../java/awt/KeyboardFocusManager.html#removePropertyChangeListener%28java.beans.PropertyChangeListener%29), [removePropertyChangeListener](../../java/awt/KeyboardFocusManager.html#removePropertyChangeListener%28java.lang.String,java.beans.PropertyChangeListener%29), [removeVetoableChangeListener](../../java/awt/KeyboardFocusManager.html#removeVetoableChangeListener%28java.beans.VetoableChangeListener%29), [removeVetoableChangeListener](../../java/awt/KeyboardFocusManager.html#removeVetoableChangeListener%28java.lang.String,java.beans.VetoableChangeListener%29), [setCurrentKeyboardFocusManager](../../java/awt/KeyboardFocusManager.html#setCurrentKeyboardFocusManager%28java.awt.KeyboardFocusManager%29), [setDefaultFocusTraversalKeys](../../java/awt/KeyboardFocusManager.html#setDefaultFocusTraversalKeys%28int,java.util.Set%29), [setDefaultFocusTraversalPolicy](../../java/awt/KeyboardFocusManager.html#setDefaultFocusTraversalPolicy%28java.awt.FocusTraversalPolicy%29), [setGlobalActiveWindow](../../java/awt/KeyboardFocusManager.html#setGlobalActiveWindow%28java.awt.Window%29), [setGlobalCurrentFocusCycleRoot](../../java/awt/KeyboardFocusManager.html#setGlobalCurrentFocusCycleRoot%28java.awt.Container%29), [setGlobalFocusedWindow](../../java/awt/KeyboardFocusManager.html#setGlobalFocusedWindow%28java.awt.Window%29), [setGlobalFocusOwner](../../java/awt/KeyboardFocusManager.html#setGlobalFocusOwner%28java.awt.Component%29), [setGlobalPermanentFocusOwner](../../java/awt/KeyboardFocusManager.html#setGlobalPermanentFocusOwner%28java.awt.Component%29), [upFocusCycle](../../java/awt/KeyboardFocusManager.html#upFocusCycle%28%29)
Methods declared in class java.lang.Object
[clone](../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)
Field Details
FOCUS_MANAGER_CLASS_PROPERTY
public static final String FOCUS_MANAGER_CLASS_PROPERTY
This field is obsolete, and its use is discouraged since its specification is incompatible with the 1.4 focus APIs. The current FocusManager is no longer a property of the UI. Client code must query for the current FocusManager usingKeyboardFocusManager.getCurrentKeyboardFocusManager()
. See the Focus Specification for more information.
See Also:
KeyboardFocusManager.getCurrentKeyboardFocusManager(), Focus Specification, Constant Field ValuesConstructor Details
FocusManager
public FocusManager()
Method Details
getCurrentManager
Returns the current
KeyboardFocusManager
instance for the calling thread's context.
Returns:
this thread's context'sKeyboardFocusManager
See Also:
setCurrentManager(javax.swing.FocusManager)setCurrentManager
Sets the current
KeyboardFocusManager
instance for the calling thread's context. Ifnull
is specified, then the currentKeyboardFocusManager
is replaced with a new instance ofDefaultKeyboardFocusManager
.
If aSecurityManager
is installed, the calling thread must be granted theAWTPermission
"replaceKeyboardFocusManager" in order to replace the the currentKeyboardFocusManager
. If this permission is not granted, this method will throw aSecurityException
, and the currentKeyboardFocusManager
will be unchanged.
Parameters:
aFocusManager
- the newKeyboardFocusManager
for this thread's context
Throws:
[SecurityException](../../../java.base/java/lang/SecurityException.html "class in java.lang")
- if the calling thread does not have permission to replace the currentKeyboardFocusManager
See Also:
getCurrentManager(), DefaultKeyboardFocusManagerdisableSwingFocusManager
@Deprecated public static void disableSwingFocusManager()
Changes the currentKeyboardFocusManager
's defaultFocusTraversalPolicy
toDefaultFocusTraversalPolicy
.
See Also:
DefaultFocusTraversalPolicy, KeyboardFocusManager.setDefaultFocusTraversalPolicy(java.awt.FocusTraversalPolicy)isFocusManagerEnabled
@Deprecated public static boolean isFocusManagerEnabled()
Returns whether the application has invokeddisableSwingFocusManager()
.
Returns:
true
if focus manager is enabled.
See Also:
disableSwingFocusManager()