title: Java image will not display when imported from source folder
body: <p>I am a beginner in coding, and I am experimenting with GUI objects.  Using BlueJ, I ran into trouble when using images when I noticed that they would not display when I packed them into a .jar</p>
  
  <p>One of the solutions I read was to put the images in a "src" folder and import the sources in the classes where they're used.  I attempted to use that method here.  I had it working, but I modified some code and now I can't find what's wrong with it.</p>
  
  <pre><code>import java.awt.*;
  import java.io.*;
  import javax.swing.*;
  
  public class getResources
  {
  public static void showPicture(int file)
  {
      String stringFile = String.valueOf(file);
      JFrame window = new JFrame("Picture Window");
      JPanel panel = new JPanel();
      panel.setLayout(new FlowLayout());
  
      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      InputStream input = classLoader.getResourceAsStream("/" + stringFile + ".png");
  
      JLabel picture = new JLabel(new ImageIcon("/" + stringFile + ".png"));
      JLabel indicate = new JLabel();
      indicate.setText(stringFile);
      panel.add(indicate);
      panel.add(picture);
  
      window.getContentPane().add(panel, BorderLayout.CENTER);
      window.pack();
      window.setLocationRelativeTo(null);
      window.setVisible(true);
  }
  </code></pre>
  
  <p>}</p>