Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Swing / AWT / SWT
display JFileChooser icon running a jar
Giulietta Blumarine
Ranch Hand
Posts: 59
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi!
If I run my application in Eclipse (or however in a development environment) the JFileChooser icon appears, but if I pack my application in a jar (throught
Ant
) and run it , the icon doesn't appear....
Any ideas?
Thanks in advance
Giu
Michael Dunn
Ranch Hand
Posts: 4632
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
your own icon?
if you load the icon like this
frame.setIconImage(new ImageIcon("Save.gif").getImage()); change it to try { frame.setIconImage(javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("Save.gif"), "Save.gif"))); } catch(Exception e){}//default will display
(and the capitalization of the file name needs to be exact)
Wanna see my flashlight? How about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
defaulting DB file location - B&S
Desktop icon on NT4, Win98SE, XP, etc
JBuilderX: How do I put my own icon on my application? It comes out with the "J" icon
Changing Default Icon of JFileChooser
JFileChooser on Solaris : Cant select directories
More...