Problem:
Moving the JMenuBar to the screen menu bar using System.setProperty("apple.laf.useScreenMenuBar", "true") leaves blank space in the window where the menu would normally reside.
Answer:
The blank space issue can be resolved by performing the following steps:
java -Dapple.laf.useScreenMenuBar=true -jar MyApplication.jar
<key>Properties</key> <dict> <key>apple.laf.useScreenMenuBar</key> <string>true</string> ... </dict>
Note:
The issue does not occur when following the approach suggested in the provided code sample. Other factors, such as the missing DesktopMain component, may contribute to the problem.
The above is the detailed content of How to Eliminate Blank Space When Moving a JMenuBar to the Mac Screen Menu Bar?. For more information, please follow other related articles on the PHP Chinese website!