If you can target Java 6 update 10 or better, you can simplify your life:
<script src="http://java.com/js/deployJava.js"></script>
<script>
var attributes = {codebase:'http://java.sun.com/products/plugin/1.5.0/demos/jfc/Java2D',
code:'java2d.Java2DemoApplet.class',
archive:'Java2Demo.jar',
width:710, height:540} ;
var parameters = {fontSize:16} ;
var version = '1.6' ;
deployJava.runApplet(attributes, parameters, version);
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…