I am making a simple game where numbers fall from top to bottom and I have to enter the number. (the number is erased when I dial the number) This is coordinated with Zen.java, which is a JApplet file.
I am trying to create a menu for this game with a typical menu bar. So far I have tried this.
public class MenuApplet extends JApplet{ public void init(){ JMenuBar menubar = new JMenuBar(); JMenu menuOption = new JMenu("Option"); JMenuItem NewGame = new JMenuItem("New Game"); menuOption.add(NewGame); JMenuItem exitGame = new JMenuItem("Exit Game"); menuOption.add(exitGame); JMenu menuLevel = new JMenu("Level"); JMenuItem levelOne = new JMenuItem("Level One"); JMenuItem levelTwo = new JMenuItem("Level Two"); JMenuItem levelThree = new JMenuItem("Level Three"); } }
Right in front of my main method. However, the menu bar is not even displayed.
I would be grateful for a couple of tips.
source share