Integration Into an Applet

To integrate the Quaqua Look and Feel in an applet, you need to do the following:

  1. Include the file quaqua.jar in the class path.
    If you don't need the full functionality of the Quaqua Look and Feel, you can include one of the following files instead: quaqua-filechooser-only.jar, quaqua-colorchooser-only.jar or the quaqua-menu-only.jar.
  2. Change the code of the init method according the following code snippet: 

public class MyApplet extends JApplet {
     public void init() {
         try {
         // set system properties here that affect Quaqua
         // for example the default layout policy for tabbed
         // panes:

             QuaquaManager.setProperty(
                "Quaqua.tabLayoutPolicy","wrap"

             );

         // configure the class loader of the UIManager.
             UIManager.put(

                 "ClassLoader", getClass().getClassLoader()
             );
         // set the Quaqua Look and Feel in the UIManager.
             UIManager.setLookAndFeel(
                 ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel();
             );
         } catch (Exception e) {
             // take an appropriate action here
             ...
         }
         // insert your application initialization code here
         ...
     }
}

Alternatively, Quaqua can be set in the UIManager using a class name String. This should be avoided, because the class name may change due to incompatible changes in the Java API.

Quaqua can be customized using System properties and UIManager properties and Client properties. Since applets are running in a protected environment, which often disallows changing System properties, you have to use method QuaquaManager.setProperty in place of System.setProperty.