Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2440

Re: how to set image path

From "Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Subject Re: how to set image path
Message-ID <bc9le35g1fnaclve2qmdrqojrtchmfosuk@4ax.com> (permalink)
Newsgroups comp.lang.java.gui
References <1189711839.468323.96930@k79g2000hse.googlegroups.com>
Date 2011-04-27 15:39 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On Thu, 13 Sep 2007 12:30:39 -0700, marcussilfver@gmail.com wrote,
quoted or indirectly quoted someone who said :

>How can I specify which folder JVM will look for images?
>I use getClass().getClassLoader().getResource("myimage")
>Right now it looks in ../ directory but I would really like it to look
>in my ../../src/ directory

The image path is the same as the classpath.  See
http://mindprod.com/jgloss/classpath.html for how the classpath works.

Usually you put resources in a jar file where you have better control
over them.

see http://mindprod.com/jgloss/jar.html

-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

how to set image path "marcussilfver" <marcussilfver@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
  Re: how to set image path a24900@googlemail.com.remove-dii-this - 2011-04-27 15:39 +0000
    Re: how to set image path "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: how to set image path a24900@googlemail.com.remove-dii-this - 2011-04-27 15:39 +0000
    Re: how to set image path "marcussilfver" <marcussilfver@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: how to set image path "marcussilfver" <marcussilfver@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: how to set image path "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: how to set image path "Nigel Wade" <nigel.wade@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: how to set image path a24900@googlemail.com.remove-dii-this - 2011-04-27 15:39 +0000
  Re: how to set image path "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000

csiph-web