I am creating a jar file which when run displays an image the image path is hardcoded ie the whole path is written. So whenever the jar file is run on a different computer to my own the image is not shown.

So my question is how is it possible to display the image without explicity writing where the file is located, rather within the package itself?

Thanks in advance

Recommended Answers

All 4 Replies

by making sure the image is always in the same folder with your application and using relative paths

Not a problem :) If you found your solution, please mark this thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.