943,678 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 5783
  • Java RSS
Dec 4th, 2008
0

Image Path

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dominic23jones is offline Offline
6 posts
since May 2008
Dec 4th, 2008
0

Re: Image Path

by making sure the image is always in the same folder with your application and using relative paths
Reputation Points: 919
Solved Threads: 354
Nearly a Posting Maven
stultuske is offline Offline
2,487 posts
since Jan 2007
Dec 4th, 2008
0

Re: Image Path

Read this thread: http://www.daniweb.com/forums/thread42410.html

You'll find that there are multiple ways to do what you need. I suggested getResource().
Reputation Points: 56
Solved Threads: 11
Junior Poster
PoovenM is offline Offline
147 posts
since Aug 2006
Dec 4th, 2008
0

Re: Image Path

thanks brother
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dominic23jones is offline Offline
6 posts
since May 2008
Dec 17th, 2008
0

Re: Image Path

Not a problem If you found your solution, please mark this thread as solved.
Reputation Points: 56
Solved Threads: 11
Junior Poster
PoovenM is offline Offline
147 posts
since Aug 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: about big endian and little endian representation
Next Thread in Java Forum Timeline: To get ip in j2me





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC