I am basically trying to make a TicTacToe game in Netbeans GUI builder. I have nine(3x3) buttons to show a grid for the game and that's where you mark X and O's. I want to make it one player game.
I wanted to know how to make an array of buttons(JButton).?It is needed to conveniently flip over different buttons.
In the game, computer would need to play with another player and has to mark O and X randomly across nine buttons. So , can you pls also tell me how to randomly shuffle over elements in button array and choose a button that is not currently marked, which would be used by computer player to mark his turn.?
I have not started with the code yet, so i am giving any sample code. Your help would be greatly appreciated. Pls help