Example usage for javax.swing JComponent getFocusTraversalKeys

List of usage examples for javax.swing JComponent getFocusTraversalKeys

Introduction

In this page you can find the example usage for javax.swing JComponent getFocusTraversalKeys.

Prototype

public Set<AWTKeyStroke> getFocusTraversalKeys(int id) 

Source Link

Document

Returns the Set of focus traversal keys for a given traversal operation for this Container.

Usage

From source file:Main.java

public static void setComponentTraversalKeys(int direction, JComponent component, KeyStroke stroke) {
    Set<AWTKeyStroke> forwardKeys = component.getFocusTraversalKeys(direction);
    Set<AWTKeyStroke> newForwardKeys = new HashSet<AWTKeyStroke>(forwardKeys);
    newForwardKeys.add(stroke);/*www.ja va2 s .c  o  m*/
    component.setFocusTraversalKeys(direction, newForwardKeys);
}