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.