Can't make my first ever applet work.

Here's the html:

Java Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="">
 <title>Rippon's web page!!</title>

 <h1>This is my heading</h1>

 <p>This is my first paragraph.</p>

 <p>This is my second paragraph.</p>

 <p>Here's my first Java Applet: </p> <p><br></br></p>
 <object classid="FirstApplet.class" width="300" height ="300" > </object>
and here's my java code:

Java Code:
  //Reference the required Java libraries
 import java.applet.Applet; 
 import java.awt.*;
// The tutorial I found on the web told me to include the lines above, but
// I've also read somewhere else that I should be doing the more modern version,
// which means the import below and extending JApplet instead of Applet in the header
// for FirstApplet
 import javax.swing.JApplet;
 //The applet code
 public class FirstApplet extends JApplet {
     public void paint(Graphics g) {
       //Draw a rectangle width=250, height=100
       //Set the color to blue
       //Write the message to the web page
       g.drawString("Look at me, I'm a Java Applet!",10,50); 
All the text between <p> tags appears fine, but nothing appears from the java code.
I have actually gotten this to work previously, under different circumstances, e.g. using <applet> instead of <object>, but then I encountered other problems: e.g. when I changed the java code to display new stuff, the old stuff kept appearing, even when previous .class files had been deleted and new ones created through recompilations of new .java files.

Help! - please :)