So I'm using Java to make a minesweeper game and I'm having some trouble with the grid.
I decided to make a 2D array of buttons.
I'm getting an outOfBoundsException with:
JButton [] [] grid = new JButton [rows] [columns];
rows and columns change depending on the difficulty.
But it doesn't matter if I choose easy, medium, or hard because the run-time error pops up after I choose what difficulty.