gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-10-30 21:30:22 25 4
gpt4 key购买 nike

我正在使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com