Skip to main content

JXDatePicker use case

No replies
Joined: 2004-09-06

I gather JXDatePicker is a work in progress, so thought I'd post how we're using it at the moment as a use case.

We have a form with multiple fields, several of which are date pickers. The general idiom for other textual components on the form is that entering information causes a real time per keypress response (validation, result-prefetching or whatever). In the rare case that our user wants to hand-enter a date rather than use the calendar control, we would like it to follow the same idiom.

I've no idea how common such a use case is, or whether it's something that should be officially supported, but it is quite difficult at the moment, which is a shame. And flew in the face of my previous experience of SwingX components - that they did The Right Thing easily. :)

(For posterity, my current solution is a DocumentListener on the JFormattedTextField which repeats the parsing logic, as a commit potentially changes the contents of the field as the user is typing.)