is Arrow Key - Java Swing

Java examples for Swing:Key Event

Description

is Arrow Key

Demo Code


//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
    }
}

Related Tutorials