private void browseHistory(KeyEvent e) {
        int c = e.getKeyCode();
        String command = "";

        if (c == KeyEvent.VK_UP)
            command = CommandHistory.getPrevious();
        else if (c == KeyEvent.VK_DOWN)
            command = CommandHistory.getNext();

        if ( command.length() == 0)
            return;

        e.consume();

        setText(command);
        selectAll();
    }