public synchronized void actionPerformed(ActionEvent e) {
        if (e.getActionCommand().equals(BUTTON_NEW_GAME)) {
            if (JOptionPane.showConfirmDialog(view, 
                                              "Start a new game of the current size?",
                                              "New Game?",
                                              JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
                System.out.println(e);
                view.removeController(); // This is going to take a while.
                board = new JManBoard();
                view.addController(this);
                view.repaint();          // Repaint the board & exit handler
                return;
            }
        }
        
        /** Set field nextJManDirection to the direction in which JMan should move.
          *  It should be one of the JManBoard constants MOVE_UP, MOVE_DOWN, 
          *  MOVE_LEFT, or MOVE_RIGHT */
        if (e.getActionCommand().equals(BUTTON_UP)) {
            board.changeJManDirection(JManBoard.MOVE_UP);
        } else if (e.getActionCommand().equals(BUTTON_DOWN)) {
            board.changeJManDirection(JManBoard.MOVE_DOWN);
        } else if (e.getActionCommand().equals(BUTTON_LEFT)) {
            board.changeJManDirection(JManBoard.MOVE_LEFT);
        } else if (e.getActionCommand().equals(BUTTON_RIGHT)) {
            board.changeJManDirection(JManBoard.MOVE_RIGHT);
        } else {
            throw new RuntimeException("Unknown button pressed in Application J*Man");
        }
        
        board.act();    // Move the computer controller pieces.
        view.repaint(); // Redisplay for the user.
    }