Example usage for java.awt AWTKeyStroke getAWTKeyStroke

List of usage examples for java.awt AWTKeyStroke getAWTKeyStroke

Introduction

In this page you can find the example usage for java.awt AWTKeyStroke getAWTKeyStroke.

Prototype

public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers) 

Source Link

Document

Returns a shared instance of an AWTKeyStroke , given a numeric key code and a set of modifiers.

Usage

From source file:MainClass.java

public MyPanel() {
    super(true);//  w  w  w . ja  v  a2s .c o m
    java.util.Set upKeys = new java.util.HashSet(1);
    upKeys.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_UP, 0));
    setFocusTraversalKeys(KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, upKeys);
}