title: Null pointer exception when adding an image as icon with NetBeans Gui Builder (auto generated code)
body: <p>Here is the auto-generated code from netbeans:</p>
  
  <pre><code>loginButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/group8/view/images/loginbutton.png"))); // NOI18N
  </code></pre>
  
  <p>and this is the error.</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at javax.swing.ImageIcon.&lt;init&gt;(ImageIcon.java:205)
      at com.group8.view.Query.initComponents(Query.java:158)
      at com.group8.view.Query.&lt;init&gt;(Query.java:43)
      at com.group8.execution.Execution.main(Execution.java:24)
  </code></pre>
  
  <p>I had this program already working. I decided to try to adapt it so I could apply Spring (trying to learn different things). Im using maven as well for the first time. Been through some tutorials and seem to get a few spring examples to work. </p>
  
  <p>Been moving the images folder all over the place because I thought it could be an issue of packaging. Now I have them where I originally had them in the other program. As a subfolder of where the actual class is. Example: Query is in a package called view and the image is in view.images.loginbutton.png</p>
  
  <p>I dont know if I need to declare the images as a maven dependency? Am I missing something super obvious?</p>