title: Accessing image paths in Eclipse
body: <p>I'm trying to access some images in my Java code. The code to call the images is below.</p>
  
  <pre><code>public final ImageIcon whitePiece = new ImageIcon(getClass().getResource("Images/whitecircle.PNG"));
  public final ImageIcon blackPiece = new ImageIcon(getClass().getResource("Images/blackcircle.png"));
  public final ImageIcon tiePiece = new ImageIcon(getClass().getResource("Images/tiecircle.PNG"));
  public final ImageIcon boardPic = new ImageIcon(getClass().getResource("Images/gameboard.PNG"));
  </code></pre>
  
  <p>However, this returns the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at javax.swing.ImageIcon.&lt;init&gt;(Unknown Source)
      at jared.othello.GameInterface.&lt;init&gt;(GameInterface.java:26)
      at jared.othello.Main.main(Main.java:22)
  </code></pre>
  
  <p>Line 26 is the first line of the above code. I am almost positive that something is wrong with my file directory naming, but I can't figure out what's wrong or how to fix it. I've created a source file named 'Images' within my project and placed the images in the folder, like so:</p>
  
  <p><img src="https://i.stack.imgur.com/3i9yY.png" alt="Project Configuration"></p>
  
  <p>What am I doing wrong, and what is the correct filename syntax? Thanks!</p>