Insight3D Applet |
This Java applet demonstrates how to use Insight3D in a web browser, by using a Java Web Start JNLP file to load the native DLLs required by Insight3D, and shows how you can interact with your application from the browser via JavaScript.
The source code files for the application can be found in the DME Component Libraries install at Examples\Insight3DApplet\.
Because Insight3D has a native DLL library, special steps must be taken to allow an applet to load that native library. Java Web Start provides a mechanism to indicate that certain JAR files contain native resources, which will be loaded automatically by the Java runtime before running the applet. These JAR files must be signed.
Java applets can be accessed from the browser via JavaScript. This example includes a very simple demonstration of how you can call a Java method from JavaScript, passing along user input from form elements on the page, and from there calling methods on Insight3D.
This example uses an Ant build script to demonstrate how to create a JAR containing the Insight3D DLLs, how to sign the JARs with a certificate, and how to create a JNLP file that will load all the parts and run the applet. See the README.txt file for more specific instructions on building and testing the applet.