Can't make my first ever applet work.

Here's the html:

Java Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>Rippon's web page!!</title>
 </head>

 <body>
 <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>
 <p>
 <object classid="FirstApplet.class" width="300" height ="300" > </object>
 </p>
 
 
 </body>
 </html>
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
       g.drawRect(0,0,250,100); 
 
       //Set the color to blue
       g.setColor(Color.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 :)