title: How to give relative path in java getResources()
body: <p>I am using eclipse juno for the java application and want to load an image on application and for that I am writing following code</p>
  
  <pre><code> URL imageURL = LoginWindow.class.getClassLoader().getResource("resources/img/pause.png");
  </code></pre>
  
  <p>which gives the following error</p>
  
  <blockquote>
    <p>Resource not found: resources/img/pause.png
    Exception in thread "main" java.lang.IllegalArgumentException: creating TrayIcon with null Image at java.awt.TrayIcon.(Unknown Source)</p>
  </blockquote>
  
  <p>but if I put the image in the folder where my java file is and remove all path and give only "pause.png" then it works properly.</p>