title: NullPointerException when using path name to load image file
body: <p>Looked everywhere and still can't find a solution to this problem while using NetBeans. </p>
  
  <p>When I use the following code to load a file by path:</p>
  
  <pre><code>Image owl = new ImageIcon(this.getClass().getResource("/images/owl.gif")).getImage();
  </code></pre>
  
  <p>I get a NullPointerException. I read somewhere where it suggested creating a new folder and making it a source file for the project, but that didn't help. I've tried multiple suggestions that I found on this site and others, but I'm not getting any results.</p>
  
  <p>I'm starting to wonder if there is something wrong with the way that I am putting the path in, but I'm doing it exactly the way that it shows everywhere else.  I've tried every combination of every example that I could find to solve this problem for the last couple of days, but nothing is working.</p>