How to deploy a java applet for today's browsers (applet, embed, object)?

Michael Siebert picture Michael Siebert · Jun 12, 2009 · Viewed 22.7k times · Source

How do i deploy a java applet for modern browsers? I know there are somehow 3 possibilities but nobody tells me which one to prefer and how to use them.

Does somebody have any resources on that? i cant find any :(

Answer

Robert Munteanu picture Robert Munteanu · Jun 12, 2009

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>