简体   繁体   English

OS X:从ShellScript启动Java / Swing应用程序时设置应用程序图标

[英]OS X: set application icon when launching Java/Swing application from shellscript

Until now I used JavaApplicationStub inside a .app directory structure to launch our Java/Swing application on OS X. The dock icon configured in the Info.plist works fine. 到目前为止,我在.app目录结构中使用JavaApplicationStub在OS X上启动Java / Swing应用程序。在Info.plist配置的Dock图标可以正常工作。

Now I've tried to launch the application using a shell-script inside the .app directory structure, but the dock icon only shows the one configured in Info.plist for a very short time and then falls back to the Java default icon. 现在,我尝试使用.app目录结构中的shell脚本启动应用程序,但是停靠图标仅在很短的时间内显示在Info.plist配置的图标,然后又退回到Java默认图标。 What I need to do that the configured icon remains there? 我需要做的是将配置的图标保留在那里?

OK, I've found the solution. 好的,我找到了解决方案。 I had to add the -Xdock:icon=<path> command line option. 我必须添加-Xdock:icon=<path>命令行选项。

您是否尝试使用Window.getIconImages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM