java: putting icons in .jar files so that Windows

2019-07-30 00:04发布

问题:

Windows knows where to find icons in .exe or .dll files. Is there any way to set up icon resources in a .jar file so that Windows can recognize them? (I'm interested in answers for XP or Windows 7)

回答1:

Java Web Start can install images to use for a desktop shortcut and menu item. JWS also supports a splash screen that can be shown while the application is loading (and/or updating new classes). The support for icons applies to any desktop PC platform for which Java is available (caveat: If the OS supports that functionality).



回答2:

This is not quite what you asked for, but I recommend using an executable wrapper like launch4j.

It will execute your Java app from a .exe and will include your icon like any other windows executable does.