static void createMenuBar(Shell s) {
		Menu bar = Display.getCurrent().getMenuBar();
		boolean hasAppMenuBar = (bar != null);
		if (bar == null) {
			bar = new Menu(s, SWT.BAR);
		} 
		
		// Populate the menu bar once if this is a screen menu bar.
		// Otherwise, we need to make a new menu bar for each shell.
		if (!createdScreenBar || !hasAppMenuBar) {
			MenuItem item = new MenuItem(bar, SWT.CASCADE);
			item.setText("File");
			Menu menu = new Menu(item);
			item.setMenu(menu);
			menu.addMenuListener(new MenuListener() {

				@Override
				public void menuHidden(MenuEvent e) {
					System.out.println("Menu closed: " + e);
				}

				@Override
				public void menuShown(MenuEvent e) {
					System.out.println("Menu open: " + e);
				}
				
			});
			MenuItem newWindow = new MenuItem(menu, SWT.PUSH);
			newWindow.setText("New Window");
			newWindow.setAccelerator(SWT.MOD1 | 'N');
			newWindow.addListener(SWT.Selection, new Listener() {
				@Override
				public void handleEvent(Event event) {
					Shell s = createShell();
					s.open();
				}
			});
			if (!SWT.getPlatform().equals("cocoa")) {
				MenuItem exit = new MenuItem(menu, SWT.PUSH);
				exit.setText("Exit");
				exit.addListener(SWT.Selection, new Listener() {
					@Override
					public void handleEvent(Event event) {
						Display d = Display.getCurrent();
						Shell[] shells = d.getShells();
						for (Shell shell : shells) {
							shell.close();
						}
					}
				});
			}
			if (!hasAppMenuBar) s.setMenuBar(bar);
			createdScreenBar = true;
		}
	}