以编程方式设置 dock:name Java Mac OS X JVM 属性
是否有一种编程替代方法可以通过执行以下操作来设置dock:name Java Mac OS X属性
java -Xdock:name="My App Name" -jar myapp.jar
,或者这是设置dock:name属性的唯一方法?
Is there a programatic alternative to setting the dock:name Java Mac OS X property by doing
java -Xdock:name="My App Name" -jar myapp.jar
, or is this the only way to set the dock:name property?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
已经有一段时间了,但我相信您需要执行以下操作(假设您使用的是 Swing):
main()
方法放在与 JFrame 不同的类中。例如:
It's been a while, but I believe you need to do the following (this is assuming you're using Swing):
main()
method in a separate class from the JFrame.For example:
Apple 扩展记录如下:
http:// developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/appledoc/api/overview-summary.html
我查看了
com.apple.eawt.Application
,这使您可以访问图标和菜单...但不幸的是,不能访问标题。我猜测规定的方法是推出您自己的应用程序包,如下所示: http://developer.apple.com/Mac/library/documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html
The Apple extensions are documented here:
http://developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/appledoc/api/overview-summary.html
I looked at
com.apple.eawt.Application
, which gives you access to the icon and menus... but not title, unfortunately.I am guessing the prescribed approach is to roll out your own App Bundle, as detailed here: http://developer.apple.com/Mac/library/documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html