How to change JavaFx native Bundle exe icon

2019-06-20 08:48发布

问题:

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.

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

回答1:

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.



回答2:

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...



回答3:

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