diff --git a/src/main/java/BattleShip/BShip.java b/src/main/java/BattleShip/BShip.java index cda0dd8..6b9054c 100644 --- a/src/main/java/BattleShip/BShip.java +++ b/src/main/java/BattleShip/BShip.java @@ -1,6 +1,8 @@ package BattleShip; import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class BShip { @@ -35,6 +37,19 @@ public class BShip { boardSize[1] = new JMenuItem("10x10"); boardSize[2] = new JMenuItem("12x12"); + JMenuBar bar = new JMenuBar(); + JMenu menu = new JMenu("file"); + JMenuItem newGame = new JMenuItem("New Game"); + newGame.addActionListener(new NewGameListener()); + JMenu sizes = new JMenu("Board Size"); + for(int i = 0; i < boardSize.length; i++) { + boardSize[i].addActionListener(new NewGameListener()); + sizes.add(boardSize[i]); + } + } + + public class NewGameListener implements ActionListener { + public void actionPerformed(ActionEvent a) {} } }