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.QuaquaLookAndFeel"
            
);
         } catch (Exception e) {
             // take an appropriate action here
             ...
         }
         // insert your application initialization code here
         ...
     }
}

 

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.