private static JMenuBar setupMenu(ActionListener listener) {

		// create the necessary menu items and menus
		JMenuBar menubar = new JMenuBar();

		JMenu gameMenu = new JMenu("Game");
		JMenuItem playItem = new JMenuItem(PLAY);
		JMenuItem exitItem = new JMenuItem(EXIT);

		gameMenu.add(playItem);
		gameMenu.add(exitItem);

		JMenu settingsMenu = new JMenu("Settings");

		JMenu difficultyMenu = new JMenu("Difficulty Level");
		ButtonGroup levelGroup = new ButtonGroup();
		JCheckBoxMenuItem easyDifficultyItem = new JCheckBoxMenuItem(EASY);
		JCheckBoxMenuItem normalDifficultyItem = new JCheckBoxMenuItem(NORMAL);
		JCheckBoxMenuItem hardDifficultyItem = new JCheckBoxMenuItem(HARD);

		normalDifficultyItem.setSelected(true); // the default setting

		// this button group ensures that only one check box is selected
		levelGroup.add(easyDifficultyItem);
		levelGroup.add(normalDifficultyItem);
		levelGroup.add(hardDifficultyItem);

		difficultyMenu.add(easyDifficultyItem);
		difficultyMenu.add(normalDifficultyItem);
		difficultyMenu.add(hardDifficultyItem);

		JMenuItem clearScoresItem = new JMenuItem(CLEAR_SCORES);

		settingsMenu.add(difficultyMenu);
		settingsMenu.add(clearScoresItem);

		menubar.add(gameMenu);
		menubar.add(settingsMenu);

		// use a single listener to handle all menu item selections
		for (int i = 0; i < menubar.getMenuCount(); ++i) {
			for (JMenuItem item : getMenuItems(menubar.getMenu(i))) {
				item.addActionListener(listener);
			}
		}

		// setup shortcuts
		playItem.setAccelerator(KeyStroke.getKeyStroke("ctrl P"));

		return menubar;
	}