List of usage examples for java.awt KeyboardFocusManager getDefaultFocusTraversalKeys
public Set<AWTKeyStroke> getDefaultFocusTraversalKeys(int id)
From source file:Main.java
/** * Adds the focus forward key./*from ww w .j a va 2 s . com*/ * * @param button * the button */ public static void addFocusForwardKey(final int button) { final KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); final Set<?> forwardKeys = manager .getDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); final Set<KeyStroke> newForwardKeys = new HashSet(forwardKeys); newForwardKeys.add(KeyStroke.getKeyStroke(button, 0)); manager.setDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, newForwardKeys); }