Example usage for java.awt.event KeyEvent VK_TAB

List of usage examples for java.awt.event KeyEvent VK_TAB

Introduction

In this page you can find the example usage for java.awt.event KeyEvent VK_TAB.

Prototype

int VK_TAB

To view the source code for java.awt.event KeyEvent VK_TAB.

Click Source Link

Document

Constant for the TAB virtual key.

Usage

From source file:edu.ku.brc.specify.tasks.subpane.wb.wbuploader.Uploader.java

/**
 * @param e/*from   w ww .jav a 2  s .c  o m*/
 * 
 * Moves to WB cell for appropriate InvalidValue and starts editing it.
 */
protected void editInvalidCell(KeyEvent e) {
    logDebug("editing invalid cell");
    int key = e.getKeyCode();
    if (key == KeyEvent.VK_ENTER || key == KeyEvent.VK_TAB || key == KeyEvent.VK_DOWN)
        goToNextInvalidCell();
    else if (key == KeyEvent.VK_UP || (key == KeyEvent.VK_TAB && e.isShiftDown()))
        goToPrevInvalidCell();
    else if (key == KeyEvent.VK_HOME)
        goToFirstInvalidCell();
    else if (key == KeyEvent.VK_END)
        goToLastInvalidCell();
}

From source file:com.osparking.osparking.Settings_System.java

private void makeEnterActAsTab() {
    KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
    KeyStroke ctrlTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_DOWN_MASK);
    Set<KeyStroke> keys = new HashSet<>();
    keys.add(enter);//from   ww  w . j av  a 2  s  . c  o  m
    keys.add(tab);
    keys.add(ctrlTab);
    KeyboardFocusManager.getCurrentKeyboardFocusManager()
            .setDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keys);
}