Java examples for Swing:Key Event
is Arrow Key
//package com.java2s; public class Main { public static int RIGHT_ARROW = 39; public static int LEFT_ARROW = 37; public static int DOWN_ARROW = 40; public static int UP_ARROW = 38; public static boolean isArrow(int key) { return key == UP_ARROW || key == DOWN_ARROW || key == LEFT_ARROW || key == RIGHT_ARROW;// w w w.j a va2s .c o m } }