JavaFX native bundle icon OS X

大兔子大兔子 提交于 2019-12-09 13:36:40

问题


I'm trying to create a native OS X app bundle for a JavaFX app using IntelliJ IDEA 14. I have set up an "Artifact" with the native bundle option set to dmg. This does create a native bundle, but I cannot seem to find a way to change the application icon. How should I go about achieving this?

I have tried placing it in the following directories based on other answers: src/main/deploy/packages/macosx/project_name.icns src/project_package_path/deploy/packages/project_name.icns

I cannot seem to find definitive information on IntelliJ's website on changing the icon either.


回答1:


I am testing an app in the app store and wanted to ensure that I got the icon set up correctly too.

If you are using the javafx ant task library you can do the following:

Place your icns file in your project root directory in package/macosx/project_name.icns

Modify your ant buildfile to include the project root in the classpath.

example:

enable verbose output for the fx:deploy task.

Open a terminal and run ant for your project.

output should contain: Building DMG package for project_name Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize) Using custom package resource [icon] (loaded from package/macosx/project_name.icns on class path)



来源:https://stackoverflow.com/questions/29303633/javafx-native-bundle-icon-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!