RSS Forums RSS

Image Path

Please support our Java advertiser: Programming Forums
Thread Solved
Reply
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

  #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
AddThis Social Bookmark Button
Reply With Quote  
Posts: 705
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 83
stultuske's Avatar
stultuske stultuske is offline Offline
Master Poster

Re: Image Path

  #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  
Posts: 137
Reputation: PoovenM is on a distinguished road 
Solved Threads: 11
PoovenM PoovenM is offline Offline
Junior Poster

Re: Image Path

  #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  
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

  #4  
Dec 4th, 2008
thanks brother
Reply With Quote  
Posts: 137
Reputation: PoovenM is on a distinguished road 
Solved Threads: 11
PoovenM PoovenM is offline Offline
Junior Poster

Re: Image Path

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

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 769 | Replies: 4 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:25 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC