且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Windows上为javafx本机程序包图标设置自定义图标

更新时间:2022-12-10 21:59:59

我只是使用Zonsky的优秀javafx-maven-plugin来解决同样的问题。从您使用的1.5版本开始,src / main / deploy目录将添加到类路径中。你想要使用的图标可以在那里添加,它将在本机构建器的类路径中可用!

I just struggled with the same issue using Zonsky's great javafx-maven-plugin. As of version 1.5, which you also were using, the src/main/deploy directory will be added to the classpath. The icon you want to use could be added there and it will be available on the classpath for the native builder!

我添加了src / main / deploy / package / windows / myapp.ico那里终于工作了:))

I added src/main/deploy/package/windows/myapp.ico there and it finally worked :)

对你来说:


  1. 创建 src / main / deploy / package / windows / 文件夹

  2. 添加名称为 $ {project。 build.finalName} .ico

  3. 运行 mvn jfx:build-native

  1. Create src/main/deploy/package/windows/ folder
  2. Add icon with name ${project.build.finalName}.ico
  3. Run mvn jfx:build-native

我没有广泛使用它 - 只是让它工作并想分享。所以如果你想使用不同名称的图标,我不知道如何。至少还没有。配置部分中的< icon> ...< / icon> 部分似乎适用于webstart,因此我一直没有使用它。
希望你能开始工作!

I haven't played with it extensively - just got it to work and wanted to share. So if you want to use icon with different name, I don't know how. Not yet at least. The <icon>...</icon> section in the config section seems to be for webstart, so I haven't been using it. Hope you get it to work!