How to change JavaFx native Bundle exe icon

2019-06-20 09:05发布

I am trying to chance the icon of the exe file created native bundling of javafx packaging but it still contains the default icon. Please suggest

 primaryStage.getIcons().add(FileUtility.loadImage("icon.png"));

did not help, it only changes the title bar and task bar icon.

default icons

The ico file still gets generated and icon of the exe files remains the default one

I also tried to assign an icon in the project properties-> Deployment-> icon but did not help

3条回答
来,给爷笑一个
2楼-- · 2019-06-20 09:30

I added response here How to set custom icon for javafx native package icon on Windows and thinks it is the same issue you started out with. However you seem to have moved on, but others might find it interesting...

查看更多
Deceive 欺骗
3楼-- · 2019-06-20 09:33

I believe I have encountered the same issue and the solution is described in the following thread.

As a side note - neither specifying your icon in the build.xml file or via the project's options in the deployment section is going to work thus far, but it seems to be fixed in the upcoming release of 7u10.

查看更多
爷、活的狠高调
4楼-- · 2019-06-20 09:33

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

For you:

Create src/main/deploy/package/windows/ folder Add icon with name ${project.build.finalName}.ico Run mvn jfx:build-native 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 ... section in the config section seems to be for webstart, so I haven't been using it. Hope you get it to work!

Answered at How to set custom icon for javafx native package icon on Windows

查看更多
登录 后发表回答