Example usage for java.awt.event KeyEvent VK_UP

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

Introduction

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

Prototype

int VK_UP

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

Click Source Link

Document

Constant for the non-numpad up arrow key.

Usage

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

public void keyPressed(KeyEvent e) {
    logDebug("keyPressed");
    int key = e.getKeyCode();
    if (key == KeyEvent.VK_ENTER || key == KeyEvent.VK_TAB || key == KeyEvent.VK_DOWN || key == KeyEvent.VK_UP
            || (key == KeyEvent.VK_TAB && e.isShiftDown()) || key == KeyEvent.VK_HOME
            || key == KeyEvent.VK_END) {
        editInvalidCell(e);/*from ww  w . j a va2 s.c o m*/
        e.consume();
    }
}

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

/**
 * @param e/*w w  w  .j a va 2 s  .  com*/
 * 
 * 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();
}