I have a pretty basic java applet that allows users to use a signature reader to sign for things through a website. Currently there is a specific page users visit in order to use the signature applet. What we would like to do is use a lightbox to load the signature applet rather than directing the users to a new page to use the applet. We haven’t been able to make it work yet due to the way the java applet is run. It appears the run applet script is only triggered on document load, and not when the script tags are inserted.
From the java deployment advice page, there is the example of the script tags we use to launch our applet.
<script src="http://www.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>
I’m not sure how to trigger the run applet code other than on document load of a new page. Is it possible to make the deploy java javascript run after loading it into a lightbox window?
This is how openprocessing does what you need:
For instance, look at this open processing example. The content of the lightbox is this page