How to change the icon of a .jar file?

1

I would like to know how to change the icon of a .jar file. Is there any way to do this using Scene Builder?

    
asked by anonymous 16.01.2015 / 03:46

1 answer

4

I do not believe that you can change the .jar file icon, since this defines the OS itself (you can even change the icon without using java, but that would change for every .jar that exists on the computer). What I've done is change the icon that stays in the taskbar and in the program window when it runs using something like this (I do not have the code with me now, but it's something very similar):

getFrame().setIconImage(Toolkit.getDefaultToolkit().getImage("caminhoDaImagem")); 

What I've seen some people doing, is using an executable wrapper to "transform" (it does not turn .jar into .exe, but I will not go into detail) .jar into an executable. Some tools for this are:

launch4j Jsmooth

    
16.01.2015 / 04:10