This example illustrates how to create a pluglet and package it into a jar which you simply place in the browser's "plugins" directory. Before we get started, let's see it run!



Code Artifacts

Creating a pluglet requires creating several code arifacts:

  1. A Java class that implements PlugletFactory.

    Details
  2. A Java class that implements Pluglet, instances of which are created and returned by the PlugletFactory.

    Details
  3. A Java class that implements PlugletStreamListener, if the Pluglet uses the getURL() or postURL() methods on the PlugletManager passed to plugletFactory.initialize().

    Details

  4. A Java JAR file containing the .class files compiled from the above Java files. The manifest for the JAR must contain the following entries:

    Manifest attribute name Explanation Value for this example
    MIMEDescription The mime-type to be handled by this pluglet. application/x-simple-pluglet
    Pluglet-Class The fully qualified class name of the Java class implementing PlugletFactory. simple.SimplePluglet
  5. Some HTML markup that includes the pluglet. Note: this step is exactly the same as for any other native plugin.

    Details