A mildly unexpected announcement on Jasper’s blog (a little earlier than hinted previously) that leads to this page on JDK 6.0 project unveils the first binary drop of Consumer JRE, or “Java SE 6 Update N” as it will be officially known. While the previous name was very catchy, the new name is very bland and generic (really, you couldn’t go with a letter more sexy than “N”?)
The naming aside, we finally get a chance to play with Nimbus. Surprisingly, the full class name is sun.swing.plaf.nimbus.NimbusLookAndFeel (why not in javax.swing?) There are a few visual glitches, as expected from early access drops. Here is a sample screenshot of an internal frame:
As you can see, while the desktop pane has a nice gradient image, other visuals still need to be improved, including the title pane main button, the title pane horizontal line and unselected enabled checkboxes and radiobuttons (they are marked as disabled and do not respond to mouse events).
It’s not clear how the community should report bugs. The feedback section points to the Swing & AWT forum, while the changelist shows that internally created bugs use the ancient and not so trustworthy bug parade.
GroupLayout was introduced in the middle of 2005 and later was added to JDK 6.0. It is the default layout manager used by NetBeans UI editor (code-named Matisse), and while the code using the GroupLayout tends to be very verbose and unreadable, the visual results are very pleasing as compared to other core Swing layout managers. For applications that require JDK 5.0, the swing-layout project provides JDK 5.0-compliant implementation.
This layout manager has introduced a concept of baseline that allows aligning components according to the perceived text baseline, instead of lining the components on the top border. This is especially relevant for form-based UIs that have grid-like arrangement of controls. In such UIs, you usually have labels in the first column followed by text fields, check boxes, combos and other controls in the subsequent columns. Here is an example:
As you can see, the alignment is far from perfect. The labels are incorrectly aligned with the text field, the combo and the password field. In addition, the labels are not spaced evenly. The implementation of GroupLayout includes hard-coded computation of baseline offsets for all core Swing components for the major core look-and-feels (Metal, Windows, Aqua and GTK). Here is how the same UI looks under Windows look-and-feel on Vista:
As you can see, the rows are aligned according to the text baseline, and the labels are equally spaced.
While this functionality is available out of the box for the core LAFs that were mentioned above and LAFs that extend those, there are three notable missing LAFs: Basic, Motif and Synth. Here is how the same UI looks under Motif:
What about the other two groups? There are a few third-party look-and-feels that extend either BasicLookAndFeel or SynthLookAndFeel. These include Alloy, Skin, Substance, Napkin, Liquid and Synthetica. Here are a few screenshots of these LAFs (Liquid, Napkin and Synthetica):
Following the request made by one of Substance users, the latest drop of Substance 4.1dev (code-named Lima) includes the new Substance Baselin plugin (that was refactored from the Substance NetBeans module). Once you add the substance-baseline.jar to your classpath, it will add the correct baseline alignment for applications that use GroupLayout from the swing-layout project under JDK 5.0.
Here are the before and after screenshots under Substance:
The license for this plugin is LGPL (the same as for the swing-layout.jar itself).
An astute reader would notice that the current implementation of JDK 5.0-compliant GroupLayout doesn’t provide builtin support for Synth-based LAFs. It would be interesting to see how Nimbus is going to address this issue, especially with the plans to backport it to JDK 5.0.
This week is witnessing a more-than-usual level of activity in the look-and-feel department. In addition to my own announcement on the release 4.0 of Substance, there are a few other items.
The first is the announcement from Fred Lavigne (creator of the Skin look-and-feel) on the updates made to the Javootoo site. The new design is much better, and the navigation bar has been reworked as well. Not to mention that the screenshots and the blurbs on the various libraries have been updated to match the latest respective versions. Here’s how Substance page looks like:
The second announcement comes from Wolfgang Zitzelsberger of Javasoft on the new version of Synthetica look-and-feel. In addition to bugfixes and new client properties, it features a new WhiteVision theme (which uses color combination similar to the Substance Creme skin):
As with all the latest animated themes, this is available under commercial license only.
As a side item, Davide Raccagni has announced a minor release 1.1.1 of his A03 look-and-feel that comes with a version compatible with JDK 5.0. And if you wondered what is the meaning behind the name, go to that link for the explanation.
Update: just as i thought we were done for the week, Jasper posted an entry on Nimbus work in progress:
Here’s a simple demo of a library that i’ve been working on over the past few months. I’m going to talk more about it over the next few entries, but for now enjoy the teaser:
In the meantime, you can view the original application graciously contributed by Paul Falstad (warning – opens a popup window with an applet) and two videos on YouTube that demonstrate how this functionality can be used (video 1 and video 2).