title: Loading resources like images while running project distributed as JAR archive
body: <p>I am having a error for my GUI. Trying to set title bar icon then be included in a Runnable JAR.</p>
  
  <pre><code>BufferedImage image = null;
  try {
      image = ImageIO.read(getClass().getClassLoader().getResource("resources/icon.gif"));
  } 
  catch (IOException e) {
      e.printStackTrace();
  }
  
  frame.setIconImage(image);
  </code></pre>
  
  <p>Here is the error I am getting:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: input == null!
      at javax.imageio.ImageIO.read(Unknown Source)
      at GUI.&lt;init&gt;(GUI.java:39)
      at GUI.main(GUI.java:351)
  </code></pre>
  
  <p>The image is in the correct directory which "resources" folder is the root of the 
  project file</p>