Deploying WebRenderer within an Applet







WebRenderer can be deployed within a Java Applet.

The following procedure is essential in securely deploying your Java applet:

1) Compile your applet and place in a JAR file
2) Create a keystore and digital key for signing your Applet
3) Sign all the  WebRenderer jar files  and your Applet JAR with your digital key
4) Set the Applet Code base location in the HTML file

Create an Applet:

import java.awt.*;
import java.applet.*;
import javax.swing.*;

import com.webrenderer.swing.*;

public class AppletBrowser extends JApplet {
        IBrowserCanvas browser;
        public static void main(String[] args) {
                AppletBrowser a = new AppletBrowser();

        public AppletBrowser() {
                BrowserFactory.setLicenseData("30dtrial", "TODO: Insert your 30 day key here");
                browser = BrowserFactory.spawnMozilla();

                JPanel panel = new JPanel(new BorderLayout());
                panel.add(BorderLayout.CENTER, browser.getComponent());
                this.setSize(600, 500);

Compilation example:

javac.exe -classpath webrenderer-swing.jar;. AppletBrowser.java
jar cvf MyApplet.jar *.class
del *.class

Digital key creation

keytool -genkey -keystore YourKeystore -alias mystore

Digitally sign the WebRenderer JAR and Applet JAR files

jarsigner -keystore YourKeystore webrenderer-swing.jar mystore
jarsigner -keystore YourKeystore MyApplet.jar mystore

Create the HTML file with the Applet references

Please note: The webrenderer-swing-xxx32.jar, the webrenderer-swing.jar and the corecomponents-swing-xxx32.jar must be specified in the Applets classpath.
<APPLET CODE="AppletBrowser.class" archive="webrenderer-swing.jar, webrenderer-swing-xxx32.jar, corecomponents-swing-xxx32.jar, MyApplet.jar" CODEBASE="." WIDTH=200 HEIGHT=200>



 Copyright JadeLiquid Software - www.jadeliquid.com