Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Icon for executable Jar file [duplicate]

Tags:

I have a simple executable Jar file. How I can set icon for this file? In my case I use the standard Jar icon which I would like to change.

enter image description here

like image 598
Peter Penzov Avatar asked Nov 12 '13 11:11

Peter Penzov


1 Answers

you can use setIconImage:

frame.setIconImage( new ImageIcon(getClass().getClassLoader().getResource("PATH/TO/YourImage.png")) ); 

Update

If you want to change the coffee-cup then you may use tools like JSmooth to create executable java file and also change the jar file icon.

As you can see in the comments JSmooth can be used for windows operating systems. For Mac you can check the link here on how to change the icon.

For linux OS you can create a desktop launcher and choose an icon image for it.

like image 140
tokhi Avatar answered Oct 18 '22 16:10

tokhi