Windows Look and Feel Fidelity 0.3 Released

Brian Duff
Brian’s Ancient Blog Posts
3 min readJan 11, 2020

This is an ancient blog post originally published by Brian Duff on 13 September 2003 on Radio Weblogs, and rescued from the Wayback Machine. The images from the original post have unfortunately been lost to time…

Release 0.3 of WinLAF is available. This release fixes the following Windows look and feel fidelity problems in Swing:

  • JOptionPane icons use correct icons on Windows XP
  • JTree folder icons use correct icons on Windows XP
  • Menu item text lines up properly on the left edge when there are icons
  • Selection color for JTree cells is changed when the cell does not have focus

…and includes fixes for a further 9 Windows Look and Feel issues from previous releases.

The winlaf project aims to provide a common place for Swing developers to track inconsistencies in the Windows Look and Feel. One goal of the project is to provide a common source of utilities that work around consistency issues. The hope is that eventually, many of the utilities provided here won’t be necessary and the underlying issues will be fixed in Java itself. In the meantime, the winlaf project provides a way to make Java applications under the Windows Look & Feel appear as close to their native counterparts as possible.

Modern notes from future Brian:

Desktop applications written in Java with the Swing toolkit were rendered using custom-drawn controls. On platforms like Windows, the Look and Feel implementation was responsible for rendering controls to resemble their native counterparts. Unfortunately, visual fidelity wasn’t always a high priority in Java, and so the components often looked and behaved differently from their native counterparts. It was particularly bad after Windows XP was released, since it had a radically different themed UI, and Java’s implementation was rushed and wildly inconsistent.

Being extraordinarily into pixel geekery at the time, I’d cared about this enough while at Oracle to maintain a bunch of patches to the official Windows Look and Feel in Java. I figured I’d open source them and see whether they were useful to others. I was surprised by how popular this project became in a very short time. Several contributors joined the project and submitted many additional patches.

An interesting side note to this and other things I was doing at the time: Oracle didn’t really have any kind of Open Source governance in place, so doing this stuff on the side was murky and ill-defined. I had at least two interesting meetings in big scary offices with Oracle Legal people at various points due to this and other projects (the outcomes of both were a go-ahead to keep on doing what I was doing). The “ask forgiveness, not permission” approach to things has served me well throughout my career, and I strongly recommend it :)

Probably the best outcome of this project was that Sun began fixing a lot of the issues (this was before OpenJDK), maybe due to a slight amount of embarrassment that the community were resorting to using a patched fork.

The source code of WinLAF is unfortunately lost, since I used a version control hosting provider that evaporated at some point. This was, needless to say, before GitHub became a thing. I more or less lost interest in the project after moving to Google in 2008, after which I no longer spent any time building desktop UIs in Swing.

--

--