Example usage for java.awt Component setFocusTraversalKeysEnabled

List of usage examples for java.awt Component setFocusTraversalKeysEnabled

Introduction

In this page you can find the example usage for java.awt Component setFocusTraversalKeysEnabled.

Prototype

public void setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled) 

Source Link

Document

Sets whether focus traversal keys are enabled for this Component.

Usage

From source file:ch.fork.AdHocRailway.ui.AdHocRailway.java

private void disableNavigationKeys(final Component comp) {
    comp.setFocusTraversalKeysEnabled(false);
    if (comp instanceof Container) {
        final Component[] children = ((Container) comp).getComponents();
        for (int i = 0; i < children.length; i++) {
            disableNavigationKeys(children[i]);
        }/*from   ww w .j ava  2s  .  c  o m*/
    }
}

From source file:Filter3dTest.java

/**
 * Creates a new InputManager that listens to input from the specified
 * component.//from www . j av a  2 s.c o m
 */
public InputManager(Component comp) {
    this.comp = comp;
    mouseLocation = new Point();
    centerLocation = new Point();

    // register key and mouse listeners
    comp.addKeyListener(this);
    comp.addMouseListener(this);
    comp.addMouseMotionListener(this);
    comp.addMouseWheelListener(this);

    // allow input of the TAB key and other keys normally
    // used for focus traversal
    comp.setFocusTraversalKeysEnabled(false);
}