One of the big advantages of swing we don't talk about much in this class is the UI Delegate and Pluggable Look and feel (PLAF). Every GUI component has a UI Delegate. Every component delegates the rendering of itself to it's UI Delegate. The UI Delegate uses the current Look and Feel to render the object. This gives several advantages. For instance if you want your application to look like a Mac application on a Mac, or a Motif application on Unix, or a Windows application on Windows, at runtime you can set the application's look and feel. If however, you want your application to look the same no matter what platform, you can use the Java look and feel and your application will look the same on all platforms. Another capability is for you to create your own look and feel. Let us say you are a game developer and you want your controls, buttons, etc. to reflect your game and not the current platform's idea of what a button, slider or other widget should look like. You create your own look and feel and now buttons look like your buttons.

Below is an example of a Java Web Start application that can change it's look and feel by selecting it from a menu. You can find this WebStart application at http://java.sun.com/products/javawebstart/demos.html. The first is the Apple look and feel, then the Motif l&f followed by the Java l&f. I didn't include Windows, I think you have seen that already :-)

Return to Java Help Page