JSpinner with date - allow user to input empty value
843804Mar 28 2005 — edited Apr 1 2005I am using JSpinner for entering time and it works fine in its current implementation. Now the users have requested that it should be possible to enter empty value, that has a different meaning for them.
One possible solution is to add a checkbox that enables/disables the field and carries the 'No value' state. But this is not user-friendly as it requires extra clicks.
I have found another solution that seemed to work for the poster at http://www.codecomments.com/archive250-2004-7-227772.html but I couldn't make it work - I couldn't understand where the code is called so that the field is empty - I always got some non-empty value.
I have also tried setting null value in the model by extending SpinnerDateModel and supporting an isNull state, but it seems I must get the editor return null to the model, and I still haven't found out how to accomplish this.
Please inform me where could I find resources that will guide me to a good solution - the ideal solution is to allow the user to delete the spinner editor contents and to have the spinner return null. Or, if you have experience with solving this it would be great if you shared it ;)
Thanks for your time and attention
Mike