Skip to main content

[JXDatePicker] - How to change JFormattedTextField Enter Key Press behavior?

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2012-03-06

I found that the JFormattedTextField in JXDatePicker auto translate the input text (if valid) to user defined date format. For example, the input text "2012-23-06" (yyyy-mm-dd) in the text box will be translated to "2013-11-06" after the enter key is pressed.

Is there any method to disable this auto translation feature?
Thanks in advance for your help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-11

hmm ... can't see how that could happen.

Try the exact same context in that you are getting this magical auto-map with a plain JFormattedTextField (using the same formatter as the datePicker's editor): if you get it there is well you either hit a bug in core or maybe something is wrong in how you set up the formatter (in both cases I would point fingers into direction away from SwingX :-) If not, you might have hit a bug in JXDatePicker: please file an issue in the swingx issue tracker containing a small runnable which demonstrates the problem.