ABOUT US

|

SUPPORT

|

BLOG

DOWNLOADS    

 

 

 

 


 

 

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() {
                super();
                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.setContentPane(panel);
                this.setSize(600, 500);
                this.show();
                this.setVisible(true);
                browser.loadURL("http://www.google.com/");
        }
}


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.
<HTML>
<APPLET CODE="AppletBrowser.class" archive="webrenderer-swing.jar, webrenderer-swing-xxx32.jar, corecomponents-swing-xxx32.jar, MyApplet.jar" CODEBASE="." WIDTH=200 HEIGHT=200>
<form>
</APPLET>
</HTML>
 

 

 

 Copyright JadeLiquid Software - www.jadeliquid.com