Kunststoff L&F
Home
Screenshots
Contributors
FAQ
History
Licence



partner link


Alloy Look and Feel



FAQ

This is a collection of answers to some of the most frequently asked questions about the Kunststoff Look&Feel.


What does "Kunststoff" mean?

Kunststoff is the German word for plastic. It is a composition of the two words Kunst and Stoff. Kunst means art, but in this case it has the meaning artificial. Stoff has the meaning stuff or material.


How can I use the Kunststoff Look&Feel in a Java™ WebStart application?

To use the Kunststoff Look&Feel in a Java™ WebStart application you will have to set the class loader, which is very simple to do. Here is an example:
try {
  com.incors.plaf.kunststoff.KunststoffLookAndFeel kunststoffLnF
    = new com.incors.plaf.kunststoff.KunststoffLookAndFeel();
  kunststoffLnF.setCurrentTheme(new com.incors.plaf.kunststoff.KunststoffTheme());
  UIManager.setLookAndFeel(kunststoffLnF);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
   // handle exception or not, whatever you prefer
}
// this line needs to be implemented in order to make JWS work properly
UIManager.getLookAndFeelDefaults().put("ClassLoader", getClass().getClassLoader());

How can I use the Kunststoff Look&Feel in an Applet?

Taoufik Romdhane has sent us this code snipplet, that should make using the Kunststoff Look&Feel in an Applet a piece of cake:
public class MyApplet extends JApplet implements Runnable {
  /**
   * Initializes the appplet.
   */

  public void init() {
    super.init();
    // Set the Look And Feel:
    initializeLookAndFeel();
    // ...
  }

  /**
   * Starts the applet.
   */
  public void start() {
    // Set the Look And Feel:
    initializeLookAndFeel();
    SwingUtilities.invokeLater(this);
    // ...
  }

  /**
   * Updates the component tree for this applet.
   */
  public final void run() {
    // Do the update:
    SwingUtilities.updateComponentTreeUI(this);
    // ...
  }

  /**
   * Installs the Kunststoff Look And Feel.
   */
  public final void initializeLookAndFeel () {
    UIManager.put("ClassLoader", GUIManager.class.getClassLoader());
    try {
      UIManager.setLookAndFeel(new KunststoffLookAndFeel());
    } catch (Exception ignored) {
    }
  }
}

How can I change the colors of the Kunststoff Look&Feel?

Changing the basic colors of the Kunststoff Look&Feel works the same as for the Metal Look&Feel. You have to create a subclass of javax.swing.plaf.metal.MetalTheme and set it as the current theme by calling the method setCurrentTheme() of the KunststoffLookAndFeel class.


If I switch from the Kunststoff Look&Feel to the Metal Look&Feel during runtime the color theme will still be the theme of the Kunststoff Look&Feel. What can I do?

The problem here is that KunststoffLookAndFeel is a subclass of MetalLookAndFeel. The color theme is a static field in the MetalLookAndFeel, which means that all instances of KunststoffLookAndFeel and MetalLookAndFeel are using one and the same color theme. To get the default metal color theme when switching to the Metal Look&Feel you will have to insert a line like this:
myMetalLookAndFeel.setCurrentTheme(new javax.swing.plaf.metal.DefaultMetalTheme())

How can I change the gradient colors?

The interface com.incors.plaf.kunststoff.GradientTheme is responsible for defining the gradient colors. Create a class that implements this interface if you want to have custom colors for your gradients. Then you can simply change the gradient theme by calling setCurrentGradientTheme() of the KunststoffLookAndFeel class.


How can I use the Kunststoff Look&Feel with Netbeans?

Put the kunstsoff.jar into the netbeans/bin directory. Add the following to the ide.cfg file:
-cp:a kunststoff.jar -ui com.incors.plaf.kunststoff.KunststoffLookAndFeel
This worked for us, but we cannot guarantee that there are no hidden problems anywhere.


Where can I find some icons that I can use with the Kunststoff Look&Feel?

Here are some links that may help: