• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Include icon image in JAR file and JAR icons

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am developing a small desktop porgram and was wondering if it were possible to include the .ico file I use for my icon image and the .png file I use for my shortcut icon inside the JAR file. I was also wondering if it is possible to change the icon of my JAR file so it uses the .png icon instaid of the default JAVA one, any help would be much appreciated . I use Netbeans IDE to build my JAR file, this is relevant as I am a newbie and I don't know how to make a JAR file except by building in Netbeans :S.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're not used to building jars, this Java™ Tutorials pages (and adjacent pages) may help
You can certainly include image files in the .jar. Don't know about changing the desktop icon, however.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Windows you can only change the icon of an executable program. However a JAR file is not an executable any more than an Excel spreadsheet is. (It's java.exe which is the executable and it uses the jar as data, just as the spreadsheet is data used by the Excel.exe executable.)
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:(It's javaw.exe which is the executable and it uses the jar as data, just as the spreadsheet is data used by the Excel.exe executable.)


There, I fixed it for you.
 
Colin McTaggart
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for the gap, I had to put this project on hold for a couple of weeks as my car was written off :S. What I do in windows just now is I have the .ico file in the install directory of my app then I manually make a windows shortcut and change the icon to my .ico. I also have a .png there that I use as my icon image. I plan on writing some code to automatically create this shortcut for me. Is it possible to store one or both of these files in the .JAR file?
 
Rototillers convert rich soil into dirt. Please note that this tiny ad is not a rototiller:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic