DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Image Path (http://www.daniweb.com/forums/thread160696.html)

dominic23jones Dec 4th, 2008 8:00 am
Image Path
 
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

stultuske Dec 4th, 2008 8:41 am
Re: Image Path
 
by making sure the image is always in the same folder with your application and using relative paths

PoovenM Dec 4th, 2008 12:23 pm
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().

dominic23jones Dec 4th, 2008 12:54 pm
Re: Image Path
 
thanks brother

PoovenM Dec 17th, 2008 3:57 pm
Re: Image Path
 
Not a problem :) If you found your solution, please mark this thread as solved.


All times are GMT -4. The time now is 7:44 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC