title: Displaying an image to a JApplet?
body: <p>I had a question about how to display a simple image to a JApplet. For some reason nothing shows up when I run this code:</p>
  
  <pre><code>import java.applet.Applet;
  import java.awt.Image;
  import java.awt.*;
  import javax.swing.*;
  
  
  public class Main extends JApplet{
  
  Image backgroundFile;
  public void init(){
      setSize(1500,750);
      backgroundFile = getImage(getCodeBase(), "Background.jpg");
  }
  public void paint(Graphics g){
      g.drawImage(backgroundFile, 20, 20, this);
  }
  }
  </code></pre>
  
  <p>It's not as if the code throws an error or something (that would be much more preferable!), rather nothing appears on the screen. </p>