Results 1 to 2 of 2
Thread: Loading files(namely images)
- 07-11-2011, 09:59 AM #1
Senior Member
- Join Date
- Jul 2011
- Location
- Melbourne, Victoria, Australia
- Posts
- 155
- Rep Power
- 2
Loading files(namely images)
Hey, whenever i have an application that loads files, which are images in most cases, I always end up having to use the complete path in order to load them. Why?
e.g:This is inconvenient.Java Code:("C:\\blah\\blah\\...etc")
Also, i usually use:
I find that whenever i just place the filename there or one folder the image is never found. This may be related to where java looks for my image and to add to that, the image is always in the same folder as all the class files and in eclispe it looks like:Java Code:ImageIO.read(new File("C:\\..."))Some help would be appreciated.Java Code:\workspace\AppName\bin\appname\
- 07-11-2011, 10:06 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Another approach is to make them resources of your application which you can load from the classpath.
See Smartly load your properties - JavaWorld for how to do it
Similar Threads
-
Loading images from an Array
By pinkette in forum New To JavaReplies: 5Last Post: 04-15-2011, 11:37 AM -
Loading large images in JavaME
By b12 in forum Advanced JavaReplies: 1Last Post: 04-01-2009, 11:02 AM -
Loading images in seperate packages?
By Bibendum in forum New To JavaReplies: 0Last Post: 03-02-2008, 10:43 PM -
Loading Images - Imp
By Thulasiraman in forum Advanced JavaReplies: 0Last Post: 01-28-2008, 09:33 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks