Skip to main content


Posted by kschaefe on September 20, 2010 at 7:05 PM PDT

I attended "Swing Tips and Tricks: A Best Practices Approach to Swing Applications" talk today.  While the talk covered well-known ground (or what I hope should be well-known ground) for Swing developers, what struck me most was that we (developers) are too often ostriches.  Putting our heads in the sand, we move forward tackling problems as they come, forgetting that more often than not, these problems are not new.  And forgetting more often then not someone else has already solved it.

This is not a critism of the presentation, but the two example problems for JTables are as I see it rather common: highlighting particular table cell with predicates and displaying the rollover row in a different color.  It must be said that some companies do not use FOSS and other only allow specific OSS licenses.  So, it is necessary to give developers the tools to solve the problems as they may be constrained by outside factors.  However, assuming that no outside factors exist, why not look for the existing solution.  For my part, I know that SwingX solves all of those issues out-of-the-box.  It is my goto tool for solving these common Swing problems.

So back to my ostrich comment: how do we do better?  Both specifically in SwingX to help users with problems that we've already tackled, but also (and perhaps more importantly) generally handle these issues?  Why is it that we developers are constantly reinventing the wheel instead of reusing someone else's?  How do we change that pattern?

Related Topics >>


Documentation, Wiki, Spread the word and Examples...

I think a big part of it is people not knowing that there is a solution readily available, and in some cases there is no direction on HOW to use it, or where to find directions on how to use it, and rolling your own is quick enough.

Take SwingX for instance, a lot of nice work has gone in to it over the years, and I have used parts of it in quite a few projects (thanks for the TreeTable), though we are still using an older version than 1.6 due to not having/taking the time to test that nothing breaks on upgrade).

So a while back I was wondering what was new and noteworthy in SwingX, but the wiki is rather poor in displaying things like that.

I think there are a couple of things that could be done
  • make it a task to spread the word (blog about cool examples and new features on, dzone, ??? (not everybody follows the swingx forum, I miss
  • make sure there are simple up to date examples that showcases the components and best practices, keep the demo project (which is nice) up to date, keep up to date
  • provide better documentation with an overview of all components and what problem they are trying to solve
  • keep the wiki up to date
  • release notes or what's new, what's next, help needed (love Eclipse's what's new)
Sure, keeping documentation and examples up to date is quite boring, but essential for reuse, and useful for tests.
if it looks like it will take longer to figure out how it works than to create your own solution people will likely just roll their own solution.