Example usage for java.awt.event KeyEvent VK_F7

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

Introduction

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

Prototype

int VK_F7

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

Click Source Link

Document

Constant for the F7 function key.

Usage

From source file:vista.ventas.DialogEntregas.java

private void eventosDeTeclas() {
    KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    manager.addKeyEventDispatcher(new KeyEventDispatcher() {
        public boolean dispatchKeyEvent(KeyEvent e) {
            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow().getClass()
                    .getSimpleName().equals("DialogEntregas")) {
                if (e.getID() == KeyEvent.KEY_PRESSED) {
                    if (e.getKeyCode() == KeyEvent.VK_F3) {
                        agregarArticulo();
                        calcularSubtotalGral();
                    }//w ww  .  java  2  s  .co m
                    if (e.getKeyCode() == KeyEvent.VK_F7) {
                        realizarVenta();
                    }
                    if (e.getKeyCode() == KeyEvent.VK_F4) {
                        cerrar();
                    }

                }
            }

            return false;
        }
    });
}