I have created an applet that, at this point, only displays an image. Running it in the AppletViewer I get the desired results, the applet opens at the correct resolution and displays the image without flaw. However, when I create an HTML file that loads the applet, it simply shows an error in the webpage that opens. How can I get the image to open in the HTML file? (Eventually I would like to have this applet embedded on a website, so if they are different please share with me how to do both) (The image is 800x600 and so is the window)

HTML File Contents:

<applet code="WebDemoMain.java" width="800" height="600">
</applet>

Applet Code:
<code>
package webDemo;
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.*;

@SuppressWarnings("serial")
public class WebDemoMain extends Applet{

Image background;
MediaTracker mediaTracker;
public WebDemoMain(){
}

public void paint(Graphics g){
setSize(800, 600);
mediaTracker = new MediaTracker(this);
background = getImage(getCodeBase(), "BlankDesktop.png");
mediaTracker.addImage(background, 0);
g.drawImage(background, 0, 0, this);
}
}
</code>

The code is of little concern as of how simple it is. I suppose my summed up question is how to load images into applets using an html file or when it is on a webpage? (I have also tried setting the image name as a parameter in the HTML file and using the: getParameter(x) method, to no avail) I appreciate the help!