Reputation: 923
When I try to add a JMenuBar to my frame in Mac, it doesn't show up. I assume it's because JMenuBar isn't integrated into the Mac native method. So can anybody help me with the code that I can use to make my bar viewable?
Upvotes: 2
Views: 206
Reputation: 205785
You can also set the apple.laf.useScreenMenuBar
property to true
in your Info.plist
, as shown here.
Upvotes: 3
Reputation: 8978
Firstly it you need to tell the JVM to use the MenuBar like:
System.setProperty("apple.laf.useScreenMenuBar", "true");
Then in your JFrame set the menu bar like so:
frame.setJMenuBar(new MenuBar());
Upvotes: 4
Reputation: 47608
Add the following VM argument to the java call:
-Dapple.laf.useScreenMenuBar=true
Upvotes: 3