JavaTM 2 Platform
Standard Ed. 6

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.KeyboardFocusManagerjava.awt.DefaultKeyboardFocusManager 替代。

有關更多資訊,請參閱 The Java Tutorial 中的 How to Use the Focus Subsystem 一節和 Focus Specification

另請參見:
Focus Specification

欄位摘要
static String FOCUS_MANAGER_CLASS_PROPERTY
          該欄位已被廢棄,不鼓勵使用它,因為它的規範與 1.4 focus API 不相容。
 
從類別 java.awt.KeyboardFocusManager 繼承的欄位
BACKWARD_TRAVERSAL_KEYS, DOWN_CYCLE_TRAVERSAL_KEYS, FORWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS
 
建構子摘要
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, 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()

JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only