File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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?
It's not a secret anymore!