title: Display an image in java
body: <pre><code>public void loadStdImage() throws IOException
  {
      Image image = ImageIO.read(this.getClass().getResource("/Resources/Images/Student/Capture.png"));  //Line 350
      ImageIcon icon = new ImageIcon(image);
      JLabel lblImage = new JLabel(icon);
      lblImage.setIcon(icon);
      lblImage.setBounds(753, 50, 149, 171);
      add(lblImage);
  }
  </code></pre>
  
  <p>I tried many things... but nothing works out. Continuously showing the following run-time error</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: input == null!
      at javax.imageio.ImageIO.read(Unknown Source)
      at View.Student.loadStdImage(Student.java:350)
  </code></pre>
  
  <p>Project folder structure is:</p>
  
  <p><a href="https://i.stack.imgur.com/A9nIP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A9nIP.png" alt="Project Explorer view in Eclipse for a project"></a></p>
  
  <p>edit:
  Found the solution. See the change of icon of the resource folder in the following picture and the above image. I added my resource folder to Java Build Path. Right click on your project, go to properties, then select 'Java Build Path', from there add your folder to java build path.
  Cheers
  <a href="https://i.stack.imgur.com/MV4Ez.png" rel="nofollow noreferrer">enter image description here</a></p>