Swing WTFs

June 30th, 2007

Over the past two+ years that i’m developing Substance, i’ve seen my share of the lengths the programmers go to bend Swing APIs to their will. The very nature of a look and feel library in most cases prevents me from asking my users to fix their code, since such a library is supposed to be a simple drop-in. So, this is just a small sample of the application quirks that found their way into Substance codebase:

  • A visible progress bar with zero bounds
  • A combobox that switched “editable” mode depending on the selected index
  • A toolbar embedded in a panel embedded in another toolbar
  • A custom table renderer providing custom painting and ignoring the opacity setting
  • A null tab in a tabbed pane to be filled only when it’s selected
  • An application running with a boot classpath loader
  • An OS-specific defect (WORA anyone?) Especially irritating if you don’t have access to such OS.

By the way, the next time you consider writing a look and feel, you’re welcome to start here.

I’m always excited to see an announcement of a new look and feel (or even a new skin in an existing look and feel). Writing such a library is quite a complicated task that requires a lot of resources and perseverance. And so, it is my great pleasure to see two new third-party look and feels announced in the last couple of days.

The first is A03 and comes from Davide Raccagni. Very nice and polished visuals, a lot of smooth animations and transitions, and even the initial theming support. It has a few interesting ideas that i would like to incorporate into future versions of Substance, such as “flowing” menus and extended file chooser. The license is very permissive (BSD), and the only thing that might hinder its acceptance is the minimum JDK requirement – JDK 6.0.

Screenshot of A03

The second is Titanium and comes from Teppefall Labs. It extends one of the dark skins from Substance and provides a modern-looking, clean and consistent skin for desktop applications. My original intent was to make Substance as extensible as possible, and this is the first time i am aware of a third-party look and feel that extends it. Hopefully, most of the extension hooks are already in place, and if not, they will be.

Screenshot of Titanium

Judging by the applications coming lately from Apple (such as native controls in Safari on Apple and iPhone), Aqua is as good as dead. Here are two screenshots from the latest iTunes (taken from the activation guide just posted on Apple site). Click to see full-size images.


ITunes shot 1 thumbnail


ITunes shot 2 thumbnail

Does this mean that the system look and feel will no longer be apple.laf.AquaLookAndFeel? Will it go back to com.apple.mrj.swing.MacLookAndFeel? Or maybe Apple JDK 6.0 will have a brand new class with a brand new name? Or maybe Apple will choose the same route as Sun did with JDK 5.0 and extend AquaLookAndFeel with a new theme (re: Metal / Ocean)?

By the way, is this the new look for tabs?

This is the eighth part in the ongoing series of providing support for SwingX components in Substance look and feel.

  • The first part showed the support for JXTaskPaneContainer and JXTaskPane.
  • The second part showed the support for JXStatusBar.
  • The third part showed the support for JXTitledPanel.
  • The fourth part showed the support for JXTipOfTheDay.
  • The fifth part showed the support for JXLoginPanel.
  • The sixth part showed the support for JXMonthView.
  • The seventh part showed the support for JXHeader.

This part will show the support for JXErrorPane. The UI delegate for JXErrorPane respects the settings of the current skin (colors, watermarks, gradients etc), which results in a consistent appearance for this UI component. Here is a screenshot of a JXErrorPane under Business skin:

The same dialog under Business Black Steel skin:

The same dialog under Creme skin:

The same dialog under Sahara skin:

The same dialog under dark Raven skin:

The same dialog under dark Magma skin:

As with JXTaskPane, JXTipOfTheDay and JXMonthView, the UI delegate for the JXErrorPane adds an extra animation. Once a JXErrorPane is shown, its icon glows for three cycles. The movie below shows this effect: