d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Minesweeper Game > Java
Add Reply New Topic New Poll
Member
Posts: 2,388
Joined: Nov 26 2006
Gold: 23.40
Jun 12 2012 12:46pm
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.
Member
Posts: 4,688
Joined: Jun 20 2009
Gold: 12,590.00
Jun 12 2012 02:45pm
Could you PM me the code and I'll take a look at it for you?
Member
Posts: 567
Joined: Apr 20 2007
Gold: 650.00
Jun 13 2012 01:09am
I can help too if you send the code
Member
Posts: 24,101
Joined: Nov 8 2007
Gold: 5,561.70
Jun 13 2012 02:01pm
Or post the code of pastebin then link it here :)
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll