title: BufferedImage won't show
body: <p>I've been trying to create a JPanel with a BufferedImage in it, the paintComponent method runs and compiles along with the constructor code that initialises the BufferedImage. Still, nothing's showing in the JFrame when I run the GUI. Any ideas? Feel free to point out any errors in my code!</p>
  
  <p>Note: you may notice all of my JButtons do System.exit, I am aware of that and it is so merely for testing purposes.</p>
  
  <pre><code>import java.awt.Image;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.JFrame;
  import java.awt.image.BufferedImage;
  import java.io.*;
  import javax.imageio.ImageIO;
  import javax.swing.ImageIcon;
  import javax.swing.JButton;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import sun.audio.*;
  import java.awt.Graphics;
  import java.awt.GridLayout;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class IntroductionComponent extends JPanel {
  
      /**
      * Generated SVUID
      */
      private static final long serialVersionUID = -1355536543860254435L;
  private BufferedImage img;
  private Audio audio;
  
  public IntroductionComponent() {
      try {
      img = ImageIO.read(new File("C:/Users/KChel-2/Downloads/HauntedHouse.jpg"));
      }
      catch (Exception e) {
          e.printStackTrace();
      }
  
  JButton start = new JButton("Start");
  start.addActionListener(e -&gt; System.exit(0));
  
  JButton opt = new JButton("Options");
  opt.addActionListener(e -&gt; System.exit(0));
  
  JButton cred = new JButton("Credits");
  cred.addActionListener(e -&gt; System.exit(0));
  
  JButton exit = new JButton("Exit");
  exit.addActionListener(e -&gt; System.exit(0));
  
  setLayout(new GridLayout(1, 2));
  
  JPanel buttons = new JPanel();
  buttons.add(start);
  buttons.add(opt);
  buttons.add(cred);
  buttons.add(exit);
  add(buttons);
  }
  
  protected void paintComponent(Graphics g) {
         super.paintComponent(g);
         g.drawImage(img, 0, 0, null);           
         }
  
  //Audio.sound1.loop();
  }
  
  
  
  import javax.swing.JFrame;
  
  public class IntroductionGUI
  {
      public static void main(String[] args)
      {
      IntroductionComponent comp = new IntroductionComponent();
  
      JFrame frame = new JFrame("The Story");
      frame.setSize(1600, 850);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      frame.add(comp);
      frame.setVisible(true);
  }
  } 
  </code></pre>