在Mac上添加MenuBar空间 [英] Adding MenuBar Space on Mac
问题描述
在PC上不会出现此问题,但是我有一台Mac,并且Java菜单栏通常出现在屏幕的左上角区域.例如(来自苹果开发者网站):
On a PC, this issue would not arise, but I have a mac and the java menu bars typically appear on the top left hand area of the screen. For example (from the apple developers website):
突出显示的蓝色菜单与Java程序中的主类相同.我想知道如何命名主方法类,在两个单词之间加一个空格而不是下划线.
The blue highlighted menu is the same name as the main class in a java program. I was wondering how I could name my main method class with a space in between two words rather than an underscore.
推荐答案
我尝试过...
- 在命令行上使用
-Xdock:name="My App Name"
设置外观前后在 -
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Not My Mac App");
main
方法中的- Using the
-Xdock:name="My App Name"
on the command line System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Not My Mac App");
within themain
method before before and after setting the look and feel
只有-Xdock:name
有效.
在10.9.4上使用Java 8进行了测试,因此对于Java和OS组合的早期版本,设置可能有所不同
Tested using Java 8 on 10.9.4, so the settings might be different for earlier version of Java and OS combinations
您还可以考虑创建一个适当的Mac .app捆绑软件,该捆绑软件应允许您通过plist
文件设置这些属性...
You may also consider creating a proper Mac .app bundle, which should allow you to set these properties via the plist
file...
看看打包Java应用程序以进行分发在Mac上.它稍稍"过时了,但应该引导您朝着正确的方向
Take a look at Packaging a Java App for Distribution on a Mac. It is "slightly" out of date, but should lead you in the right direction
这篇关于在Mac上添加MenuBar空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!