Since Java 6 Update 10 they've released a Java Deployment Kit:
The Java Deployment Toolkit makes
deploying Java applets or Java Web
Start programs a snap. The Deployment
Toolkit JavaScript file provides:
* Accurate detection of installed JREs
* Seamless JRE installation
* Complete applet launching (JRE detection and, if necessary, upgrading)
in a single line of code
* Complete Web Start program launching in a single line of code
The following HTML code is all it
takes to ensure that Java 1.6 is
installed and then a Java applet is
launched:
<script src="http://java.com/js/deployJava.js"></script>
<script>
deployJava.runApplet({codebase:"http://www.example.com/applets/",
archive:"ExampleApplet.jar", code:"Main.class",
width:"320", Height:"400"}, null, "1.6");
</script>