erhaps the single biggest challenge in writing Java applications is dealing with UI issues. Regardless of the application's power and flexibility, people will always want it to look familiarto look like a Windows application. With JGoodies you can give them what they want, and a whole lot more besides!
Java has never really been a competitor for premium desktop systems. Its very nature being that of write once, run anywhere leads to a lowest common denominator approach. For example, some operating systems support mice with three buttons, some with two and some with only one. For a Java application to run 'everywhere,' it can only support a single mouse button. The extra button functionality that could be available on other systems is lost. There are other user interface widgets and design patterns that are similarly unexploitable, and the ultimate effect is that Java never really penetrated the applications market. Visual Basic reined supreme.
However, when it comes to middleware or serverware, Java provides an amazing proposition. The same code runs your transactions, your analytics, your business apps regardless of the operating platform! Is Solaris too expensive? Replace it with Microsoft. Your software will still work. Is Microsoft too unstable? Replace it with Linux. Your software will still work!
However, the Java-based desktop may be making a comeback. Some of the pending APIs from Sun as well as innovations coming out of the open-source community are redrawing the map and will change the perception of how Java works in the desktop application environment.
For example, BEA's Weblogic Workshop 8.1, sports a truly beautiful user interface using Java. Oracle and others are also developing Java IDEs with great-looking Java UIs.
One of these transformative look-and-feel APIs is JGoodies. JGoodies is freely available and can be used in your own applications.
By browsing the JGoodies site at http://www.jgoodies.com, you'll see examples of user interfaces built using the JGoodies API. One example is shown in Figure 1, below.
Unpacking the JGoodies
|Figure 1. Previewing the Goodies: A sample user interface made using the JGoodies API is shown.|
To get started using JGoodies, download
the Look and Feel and the Forms APIs and then unzip the files to a directory on your hard drive (e.g. c:\jgoodieslooks). The result should look like Figure 2
|Figure 2. Unpack the Goodies: This is what your unzipped JGoodies directory structure should look like before you begin developing.|
For the purposes of this article you will only need the Look and Feel API, but in order to compile and test the demo application from the Look and Feel API, you will need the JAR files that come with the Forms API as well.
There are two ways to work with the JGoodies Look and Feel API:
The class must be one of the following:
The Plastic themes use a default color scheme that is appropriate for your operating system. However a method setMyCurrentTheme
is provided that allows you to override this. For example:
is a color theme specified in the com.jgoodies.plaf.plastic.theme