Results 1 to 2 of 2
  1. #1
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Melbourne, Victoria, Australia
    Rep Power

    Default 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?
    Java Code:
    This is inconvenient.
    Also, i usually use:
    Java Code: File("C:\\..."))
    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:
    Some help would be appreciated.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Rep Power


    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

  1. Loading images from an Array
    By pinkette in forum New To Java
    Replies: 5
    Last Post: 04-15-2011, 12:37 PM
  2. Loading large images in JavaME
    By b12 in forum Advanced Java
    Replies: 1
    Last Post: 04-01-2009, 12:02 PM
  3. Loading images in seperate packages?
    By Bibendum in forum New To Java
    Replies: 0
    Last Post: 03-02-2008, 11:43 PM
  4. Loading Images - Imp
    By Thulasiraman in forum Advanced Java
    Replies: 0
    Last Post: 01-28-2008, 10:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts