我正在使用 JavaFX-Gradle-plugin构建可分发的二进制文件和 JavaFX 应用程序的安装程序。当我的应用程序运行时,我可以这样设置图标:
stage.getIcons().add(new Image(this.getClass().getResourceAsStream("/isotype.png")));
正确设置正在运行的应用程序的图标:
还有任务栏:
但是如何设置开始菜单的图标:
可能还有其他地方:
最佳答案
有一个公开的 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/