0

I'm trying to deploy a JavaFX application with Eclipse/Ant + InnoCompiler. I'm able to set an icon for the stage and it is correctly visualized on the application bar when I run the application from Eclipse. However when I deploy the app and I install it, the stage icon is replaced by an horrible java gray icon. I want to remark that the installer icon (set by Inno script) works great. How can I fix it?

The icon is set with:

topStage.getIcons().add(new Image(getClass().getResourceAsStream("css/myImage.png")));

Thanks in advance.

Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
arandomuser
  • 521
  • 1
  • 7
  • 22
  • Maybe this helps you: http://stackoverflow.com/questions/10121991/javafx-application-icon – DVarga Apr 11 '16 at 10:31
  • Thank you, I already read that post...it works for me if I run the application from eclipse but not after I bundle it – arandomuser Apr 11 '16 at 11:24
  • 2
    Are you building a jar and use that jar to be included in an executable that is builded by inno setup? In this case, the problem is that the JVM cannot find your image. Try this to make sure that this is the problem: `topStage.getIcons().add(new Image(getClass().getResourceAsStream("myImage.png")));`. And also move the icon from the css to one directory upper. – DVarga Apr 11 '16 at 11:59
  • @DVarga I did as you said and now the icon shown in the application bar is the one set by Inno instead of the one of the stage. However, I can consider it a big improvement and a solution, cause I want the two to be equal. Not very clear to me but....Thank you! – arandomuser Apr 11 '16 at 15:04

0 Answers0