• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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: 76462
366
  • 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: 27372
88
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: 22684
128
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?
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic