title: How to import image into JPanel
body: <p>I am working on an assignment (GASP) and having issues with my image displaying. I am not looking for someone to complete my assignment for me but I desperately need some help figuring out why my code is not working properly. I have reviewed my Java Programming book as well as searched for the answers online to no avail so if someone could lead me in the right direction I would greatly appreciate it!!
  Here is my displayImage code:</p>
  
  <pre><code>import java.awt.Graphics;
  import java.awt.Image;
  
  import javax.swing.ImageIcon;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  
  public class DisplayImage extends JFrame {
  public void DislayImage(){
      add (new ImagePanel()); 
  }
  
  public static void main(String[] args) {
      JFrame frame = new DisplayImage (); 
      frame.setTitle("Go Bearcats!");
      frame.setSize(300, 300);
      frame.setLocationRelativeTo(null);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
      Assignment02 a = new Assignment02();
      frame.add(a); 
  
  }
  }
  class ImagePanel extends JPanel {
      public final static String LOC = "C:\\UCincinnatiLogo.jpg";
      private ImageIcon imageIcon = new ImageIcon (LOC); 
      private Image image = imageIcon.getImage(); 
  
      @Override /**Draw image on the panel*/
      protected void paintComponent(Graphics g){
          super.paintComponent(g);
  
          if (image !=null)
              g.drawImage(image, 200, 200, getWidth(), getHeight(), this); 
      }
  
   }
  </code></pre>