Hey everyone
I posted the program three times already - each time with great help: thanks. But I really need you guys to help me out NOW. I have created a simple BattleShips program, consisting of a 2X2 array, with 10 spaces. It displays the board, with the column number (char) above it and the row number (int) next to it. The program works just fine as it is, but I really want to add some GUI to it. I have imported GridLayout - java.awt - (if you run the class you will see how it looks) but I don't know how to implement it into my BattleShips.
I basically need to shadow the spaces of the array (whether it contains a value or not) with GridLayout to allow the user to click on the space to show the value of the array.
A miss (or blank space) = 'M' and all other values (ship, battleship, aircraft carrier) = 'X' (for a hit).
Guys I really need you to help me out with it. Can anybody place GridLayout over the spaces of the array?
Thanks. The code follows:
