Monday, August 7, 2006

Swing Date Pickers

Back in April I looked around for a good open source Swing date picker for a big Swing project. I found 6 and I actually tried them all. But in the end we simply stayed with JSpinner components.

These were the must-have requirements:
1. support for typing dates directly (this is, without opening a pop-up)
2. ability to limit the selectable dates with a lower and/or upper boundary
3. good event mechanism

And some nice-to have requirements:
4. visual mouse selection
5. support for multiple date formats
6. look good
7. further limitation of selectable days, for example no weekend days

These were the date pickers I tried:
- JCommon
- MDateSelector
- SwingX's date picker
- UICollection's date picker
- JCalendar
- And there was a sixth, but I can not find it back anymore.

None of these met the must-haves. In particular requirement #1, keyboard support, is only present in the the SwingX component. In contrast good old JSpinner supports #1-#3 splendidly, but fails miserably on #4-#7.

However, my search did seem to have some result.

It started with comment on an introduction on the SwingX JXDatePicker by R.J. Lorimer on JavaLobby. This guy writes good stuff. Then I thought, why not ask on the SwingX forum directly. So I wrote this message in search of more features. The message was followed by a lively discussion in search of requirements.

It seems that the SwingX guys picked it up and are now working on the final killer Swing date picker component!

1 comment:

  1. I have implemented JDatePicker, which lives on sourceforge. It complies to the following of your requirements (1, 3, 4, 5, 6).

    http://sourceforge.net/projects/jdatepicker

    Additionally it will soon support JodaTime, and it already supports JGoodies Binding.

    ReplyDelete