title: Getting images from a .jar file
body: <p>I need to get res folder to compile when I export a executable jar file in eclipse also when I use the <code>getClass().getResource()</code> method it doesn't work.</p>
  
  <p>Current reading image code</p>
  
  <pre><code>public Image loadImage(String fileName) {
      return new ImageIcon(fileName).getImage();
  }
  </code></pre>
  
  <p>Code that doesn't work</p>
  
  <pre><code>public Image loadImage(String fileName) {
      return new ImageIcon(getClass().getResource(fileName).getImage();
  }
  </code></pre>