title: Cant Load Image on Java (BlueJ)
body: <p>Im Trying to load my images on to Java but when running the code nothing appears inside my JFrame.</p>
  
  <p>The way im doing it is calling my Image function from my main:</p>
  
  <pre><code>    import java.awt.*;              // Graphics stuff from the AWT library, here: Image
      import java.io.File;            // File I/O functionality (for loading an image)
      import javax.swing.ImageIcon;   // All images are used as "icons"
  
  
  
    public class GameImage
      {
    public static Image loadImage(String imagePathName) {
  
      // All images are loades as "icons"
      ImageIcon i = null;
  
      // Try to load the image
      File f = new File(imagePathName);
  
  
      if(f.exists()) {  // Success. Assign the image to the "icon"
          i = new ImageIcon(imagePathName);
      }
      else {           // Oops! Something is wrong.
          System.out.println("\nCould not find this image: "+imagePathName+"\nAre file       name and/or path to the file correct?");            
          System.exit(0);
      }
  
      // Done. Either return the image or "null"
      return i.getImage();
  
  } // End of loadImages method
  
  }
  </code></pre>
  
  <p>And then calling it here:</p>
  
  <pre><code>        GI_Background = GameImage.loadImage("Images//background.jpg");
      GI_DuskyDolphin = GameImage.loadImage("Images//DuskyDolphin.jpg");
  </code></pre>
  
  <p>If this is not enough information I'll gladly supply the rest of the code :)
  Thanks</p>