This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to include PNG in Eclipse export? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to include PNG in Eclipse export?" Watch "How to include PNG in Eclipse export?" New topic

How to include PNG in Eclipse export?

Ravi Shankarappa
Ranch Hand

Joined: Jan 09, 2010
Posts: 55

I load a .png file and display it in a JPanel when my program (see below) starts.

When I run it within eclipse the png is displayed correctly. However, when I export my program and run the executable jar file it doesn't. How do I include the .png file in my jar file?

I had posted the question in Eclipse forum but got no answer, so please help me.

James E Baker

Joined: Jul 28, 2011
Posts: 23
Silly question, but mySplash.png is inside your jar file, correct?
Jon Avadis
Ranch Hand

Joined: Jul 20, 2011
Posts: 49

My guess would be that your programm is just loading the png from where it is, but the png-file itself is not included in your project/jar.
In Eclipse you can just drag and drop the file into your projectfolder and eclipse will ask you, if you want to copy and safe it inside your project.

Knowledge Reigns Supreme
I agree. Here's the link:
subject: How to include PNG in Eclipse export?
Similar Threads
Issues deploying Java application
MySQL db - migrating from Access (but where is the driver?!)
Jar file creation using eclipse
Exporting to jar file in eclipse
My .PNG background will not export ||THIS HAS BEEN RESOLVED!!! THANKS!!||