|
|
@ -1,8 +1,12 @@ |
|
|
|
package BattleShip; |
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
public class BShip { |
|
|
|
|
|
|
|
public GridGUI grid1; |
|
|
|
JPanel thePanel = new JPanel(); |
|
|
|
JMenuItem[] boardSize = new JMenuItem[3]; |
|
|
|
public AIGridGUI grid2; |
|
|
|
int rows = 10; |
|
|
|
int columns = 10; |
|
|
@ -19,6 +23,18 @@ public class BShip { |
|
|
|
buildGUI(); |
|
|
|
} |
|
|
|
|
|
|
|
public void buildGUI() {} |
|
|
|
public void buildGUI() { |
|
|
|
|
|
|
|
thePanel.setLayout(new BoxLayout(thePanel, BoxLayout.PAGE_AXIS)); |
|
|
|
|
|
|
|
|
|
|
|
thePanel.add(grid1); |
|
|
|
|
|
|
|
//Setup menu with options for new game, varying board sizes, and auto placement of ships. |
|
|
|
boardSize[0] = new JMenuItem("8x8"); |
|
|
|
boardSize[1] = new JMenuItem("10x10"); |
|
|
|
boardSize[2] = new JMenuItem("12x12"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |