使用e(fx)clipse部署捆绑包 - Macos图标的问题

时间:2015-03-01 20:10:45

标签: java macos ant build efxclipse

我在这里完成了很棒的教程:http://code.makery.ch/java/javafx-8-tutorial-part7/

我在安装时会显示主应用程序图标,并用于已安装的应用程序,但我有两个图像似乎保持不变。

安装.dmg时,桌面上会显示一个图像,标题栏中的应用程序名称旁边会显示另一个图像,这两个图像仍默认为Java图标。

已包含屏幕截图,以显示安装程序窗口中正确图标的显示位置,但默认的java显示在该窗口的标题栏和桌面上的应用程序中。

我是否需要在项目的其他位置添加新的/不同名称的图像?或者我可以在build.xml中添加一些其他内容以确保这些图像也发生变化吗?

非常感谢任何帮助。干杯:)

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:2)

您是否也在代码中设置了舞台的图标?

        Image icon16 = new Image(getClass().getResource("logo_16x16.png").toExternalForm());
        Image icon32 = new Image(getClass().getResource("logo_32x32.png").toExternalForm());
        Image icon64 = new Image(getClass().getResource("logo_64x64.png").toExternalForm());
        Image icon128 = new Image(getClass().getResource("logo_128x128.png").toExternalForm());
        assert icon16 != null && icon32 != null && icon64 != null && icon128 != null;
        primaryStage.getIcons().addAll(icon16, icon32, icon64, icon128);

答案 1 :(得分:2)

哦,是的,所有排序!! :)

我以详细模式运行build.xml: 已将verbose="true"添加到fx:deploy代码

控制台输出现在详细说明正在使用哪些资源,以及将自己添加到自定义的位置。

对于上述问题,该行是:

Using default package resource [volume icon] (add package/macosx/AddressApp-volume.icns to the class path to customize)

将AddressApp-volume.icns文件添加到建议的位置,并将 BAM 美丽的图标添加到处! :d