title: Displaying an image in a JFrame
body: <p>I am currently learning Java, and I am stuck with something at the moment.</p>
  
  <p>I was looking for a way to add an image to my JFrame.
  I found this on the internet:</p>
  
  <pre><code>ImageIcon image = new ImageIcon("path &amp; name &amp; extension");
  JLabel imageLabel = new JLabel(image); 
  </code></pre>
  
  <p>And after implementing it to my own code, it looks like this (this is only the relevant part):</p>
  
  <pre><code>class Game1 extends JFrame
  {
      public static Display f = new Display();
      public Game1()
      {
          Game1.f.setSize(1000, 750);
          Game1.f.setResizable(false);
          Game1.f.setVisible(true);
          Game1.f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          Game1.f.setTitle("Online First Person Shooter");
  
          ImageIcon image = new ImageIcon("C:\\Users\\Meneer\\Pictures\\image.png");
          JLabel imageLabel = new JLabel(image); 
          add(imageLabel);
          }
  }
  
  class Display extends JFrame
  {
  }
  </code></pre>
  
  <p>When running this code, it doesn't give me any errors, but it also doesn't show the picture. I saw some questions and people having the same problem, but their code was completely different from mine, they used other ways to display the image.</p>