Sophie Network: Vamp HQ - Luxor XUL - Ajax - Rachel - Lopica - Shark - Viva - XUL Alliance - The Saturn Times - The Richmond Post
Luxor Family: Luxor - Luxilla - Petra - Luxor Contrib - The Memphis Sun
Petra Logo
Luxor XUL (XML UI Language) Plugin Central
Overview . Tutorial . SVG Plugin . Applet Interop . Java Bean Interop . Download . Petra @ Sourceforge

Luxor Applet Plugin Example Suite

What is Luxor's Applet Plugin Example Suite?

Luxor's Applet Plugin Example Suite holds a bunch of apps that show how to turn applets into XUL tags that you can use along with all built-in XUL tags without writing any Java glue code. Reuse your applets today in your very own apps without calling in any browser machinery.

Turning Applets Into XUL Tags - Getting Started Guide

Starting with Luxor Beta 9 you can plug-in applets and turn them into XUL tags. Pop a simple XML config file into your app's chrome config folder and your applets are ready-to-use along with all built-in XUL tags.

Hello Applet Plugin Tutorial. To help you get started I show you how to plug-in the HelloApplet and turn it into a <hello> tag for creating greetings such as "Salve Roma" or "Hello Tokyo".

The markup for using the HelloApplet in a classic pre-XUL area HTML browser

<applet code="demo.hello.HelloApplet.class" width="300" height="100" >
  <param name="greeting" value="Salve Roma" >

turns up cleaned up in XUL

<hello greeting="Salve Roma" style="width: 300; height: 100" />	     

and comes up on your screen as follows:

Plug It In, Plug It In. To plug-in your own applets and turn them into XUL tags such as <hello> add a config folder to your app's chrome folder hierachy. Example:

Use <appletdef>s inside the <config> root tag to spice up Luxor with your own applet-powered tags. <appletdef> requires two attributes: your applet's new tag name such as hello and your applet's main Java class such as demo.hello.HelloApplet.

Example: Applet Plugin Settings

  <appletdef name="hello" class="demo.hello.HelloApplet" />

You don't need to worry about configuring your applet's parameters such as greeting because Luxor turns them automatically into attributes.

Store your applet plugin config settings in the config folder, say, in plugins.xul. Note, that you can choose whatever name you like because Luxor picks up all files in the config folder to configure itself once you call XulManager.configure().

That's it. Now you can use <hello> like a built-in XUL tag in your app's chrome.

Example: <hello> Applet Plugin in Action

<vbox id="CONTENT">
    <caption label="Applet Demo I" />	 
    <hello greeting="Salve Luxor" style="width:300; height:100" />    
    <caption label="Applet Demo II" />	 	 
    <hello greeting="Hello Luxor" style="width:300; height:100" />

Packing Your Applets. Note, that Luxor doesn't load your applets on-demand over the net like a classic HTML browser instead Luxor assumes that you already shuffled all your applets' jars onto your harddisk and included the applets' jars to your classpath.

Limitations. Under Construction.

Luxor's applet plugin support is experimental (that is, not complete yet). Luxor doesn't support any applet services such as getImage(), getAudioClip() and others except getParameter().

Hosted by SourceForge SourceForge Logo Send your comments, suggestions, praise or poems to Copyright © 2003 Gerald Bauer