public void openCell(int x, int y) {
        final Cell cell = cells[x][y];

        // Force open cells
        if (cell.getState() == Cell.State.OPEN) {
            forceOpenCells(x, y);
        }

        // Dont open a flagged cell
        if (cell.getType() == Cell.Type.FLAGGED ||
                cell.getType() == Cell.Type.FLAGGED_MINE)
            return;

        // Open cell up and check if its a mine
        cell.setState(Cell.State.OPEN);
        if (cell.getType() == Cell.Type.MINE) {
            revealMines();
            JOptionPane.showMessageDialog(null, "You opened a mine. Good game.");
            setup();
            return;
        }

        // Stop opening when we get to a cell that has mines around it
        if (cell.surroundingBombs > 0) {
            return;
        }

        // Recursively open adjacent cells
        List<Cell> surroundingCells = getSurroundingCells(cell);
        for (Cell c : surroundingCells) {
            if (c.getState() == Cell.State.CLOSED)
                openCell(c.x, c.y);
        }
    }