KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
manager.addKeyEventDispatcher(new KeyEventDispatcher() {
@Override
public boolean dispatchKeyEvent(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if(keyCode == 38 || keyCode == 40){
return true;
}else{
return false;
}
}
});
manager.addKeyEventDispatcher(new KeyEventDispatcher() {
@Override
public boolean dispatchKeyEvent(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if(keyCode == 38 || keyCode == 40){
return true;
}else{
return false;
}
}
});