private void updateChanges()
    {
        Map<Integer, BoxState> changes = game.getLastChanges();
        for (Map.Entry<Integer, BoxState> entry : changes.entrySet()) {
            int index = entry.getKey();
            BoxState state = entry.getValue();
            switch (state) {
            case SAFE:
                setButton(index, false, null, Integer.toString(game.getMapValue(index)));
                break;
                
            case MINE:
                setButton(index, false, mineIcon, "");
                break;
                
            case UNEXPLORED:
                setButton(index, true, null, "");
                break;
                
            case FLAGGED:
                setButton(index, true, flagIcon, "");
                break;

            default:
                break;
            }
        }
        minesLeft.setText(Integer.toString(game.minesLeft()));
        if (game.isGameOver()) {
            newGameDialog("Game Over!");
        }
        if (game.isWon()) {
            newGameDialog("You win!");
        }
    }