Putting JMenu on the Mac menu bar

java, jmenu, macos, swing

Solution

You can set a System property to do so. The first example on http://developer.apple.com/library/mac/#documentation/Java/Reference/Java_PropertiesRef/Articles/JavaSystemProperties.html mentions to use `System.setProperty("apple.laf.useScreenMenuBar", "true");` to put your menu into the menubar.

Problem

I'm creating an java application on a Mac that uses Swing `JMenu`s. I would like to use the menu bar on the top of the screen, but it keeps on putting the menu bar in the frame itself. How do you move the menu bar to the top of the screen on a Mac?

Original source

Related problems