List of usage examples for javax.swing JButton setFocusTraversalKeys
public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
From source file:Main.java
public static void main(String[] argv) throws Exception { JButton component = new JButton("a"); Set set = new HashSet(component.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS)); set.add(KeyStroke.getKeyStroke("F2")); component.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set); }
From source file:Main.java
public static void main(String[] argv) throws Exception { JButton component = new JButton("a"); Set<AWTKeyStroke> set = new HashSet<AWTKeyStroke>( component.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS)); set.add(KeyStroke.getKeyStroke("F2")); component.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set); }