Image Path

Thread Solved
Reply

Join Date: May 2008
Posts: 6
Reputation: dominic23jones is an unknown quantity at this point 
Solved Threads: 0
dominic23jones's Avatar
dominic23jones dominic23jones is offline Offline
Newbie Poster

Image Path

 
0
  #1
Dec 4th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 706
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 84
stultuske's Avatar
stultuske stultuske is offline Offline
Master Poster

Re: Image Path

 
0
  #2
Dec 4th, 2008
by making sure the image is always in the same folder with your application and using relative paths
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 137
Reputation: PoovenM is on a distinguished road 
Solved Threads: 11
PoovenM PoovenM is offline Offline
Junior Poster

Re: Image Path

 
0
  #3
Dec 4th, 2008
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().
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 6
Reputation: dominic23jones is an unknown quantity at this point 
Solved Threads: 0
dominic23jones's Avatar
dominic23jones dominic23jones is offline Offline
Newbie Poster

Re: Image Path

 
0
  #4
Dec 4th, 2008
thanks brother
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 137
Reputation: PoovenM is on a distinguished road 
Solved Threads: 11
PoovenM PoovenM is offline Offline
Junior Poster

Re: Image Path

 
0
  #5
Dec 17th, 2008
Not a problem If you found your solution, please mark this thread as solved.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC