title: NullPointerException when using a classLoader for loading an ImageIcon
body: <p>Why do I get a nullPointerException when using ClassLoader</p>
  
  <pre><code>ClassLoader cl = ClassLoader.getSystemClassLoader();
  ImageIcon img = new ImageIcon(cl.getResource("logo.png"));
  </code></pre>
  
  <p><em>The NullPointerException is, according to Eclipse, on the same row where the imageIcon is created</em></p>
  
  <p>the image <strong>is</strong> there because the following works fine:</p>
  
  <pre><code> ImageIcon img = new ImageIcon("logo.png");
  </code></pre>
  
  <p><em>I am using classloader because I want to include it in an executable jar.</em></p>
  
  <p>the project in the explorer of Eclipse. The main-function is in Gui.java</p>
  
  <p><img src="https://i.stack.imgur.com/KHoqm.jpg" alt="screen shot of project resource view"></p>