Set Icon for executable Jar file [duplicate]

This question already has answers here:

you can use setIconImage:

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


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.


Is there a compiler optimization for the size() methods of Collections in Java? Consider the following code: for(int i=0;i<list.size();i++) ...some operation..... There is a call to ...

How to build the following PSQL query to update multiple records using jOOQ 3.10.x? UPDATE users SET name =, city = FROM users_staging s WHERE =;

I would like to parse two separate strings "1982" and "SEP" into a java.time.YearMonth object. java.time.YearMonth.parse("1978 SEP", java.time.format.DateTimeFormatter.ofPattern("yyyy LLL")) gives ...

I compiled my program and I got the following error. How should I resolve it? Note: uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.