java - 如何在 JavaFX 中设置应用程序安装程序图标?

标签 java windows javafx installation javafx-gradle-plugin

我正在使用 JavaFX-Gradle-plugin构建可分发的二进制文件和 JavaFX 应用程序的安装程序。当我的应用程序运行时,我可以这样设置图标:

stage.getIcons().add(new Image(this.getClass().getResourceAsStream("/isotype.png")));

正确设置正在运行的应用程序的图标:

enter image description here

还有任务栏:

enter image description here

但是如何设置开始菜单的图标:

enter image description here

可能还有其他地方:

enter image description here

最佳答案

有一个公开的 pull request 记录了这个 here

它说:

Customize Icons

To customize the icons used in a native bundle, you have to provide the icons for the appropriate bundle. The icons must follow the file name convention in order to get picked up.

Tip: Set the verbose setting to true, to have log which files are picked up from your deploy directory.

特别是对于 Microsoft Windows:

Windows

Icon location: src/main/deploy/windows

For Windows you can provide two different icons.

  • application icon
  • setup icon - the icon of the installer

| Type | Filename | | :---------------- |:------------------------- | | .exe icon | \<appName>.ico | | setup exe icon | \<appName>-setup-icon.bmp |

不管那里怎么说,正确的路径是 src/main/deploy/packages/windows,如 adjusted-launcher-icon example 中所示。

关于java - 如何在 JavaFX 中设置应用程序安装程序图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47743538/

相关文章:

java - 何时使用事件总线?

java - 简单的Java Web服务问题

java - JOOQ 记录映射器在加入时映射了错误的 ID

java - 保存时间戳对象列表的数据结构

javafx标签不显示循环结果

c - KeQueryTickCount 正确使用

c# - Windows 窗体中的默认按钮点击(试图找到最佳解决方案)

django - 如何解决Windows上的Django中需要: ImproperlyConfigured: mysqlclient 1. 3.13或更高版本的错误?

java - 选择 TreeTableRow 不会更改背景颜色

java - 将 JFoenix JFXDialogLayout 警报通知代码重构为更简单的形式,以便可以重用于其他类