public void keyPressed(KeyEvent evt) {
        /** store old selection */
        int newSelection = selection;
        switch (evt.getKeyCode()) {
            case KeyEvent.VK_UP:
            case KeyEvent.VK_LEFT: newSelection -= 1; break;
            case KeyEvent.VK_DOWN:
            case KeyEvent.VK_RIGHT: newSelection += 1; break;
            case KeyEvent.VK_ENTER: doCommand(selection);
        }
        /** if selection is new */
        if (selection != newSelection) {
            /** if new selection is less than 0 then set it to exit button */
            if (newSelection < 0) newSelection = EXIT;
            /** deselect old selection */
            imageButtons[selection].setBevel(false);
            /** set up selection */
            selection = newSelection;
            selection %= 5;
            /** select new selection */
            imageButtons[selection].setBevel(true);
        }
    }