<p>I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should "jump" the slashes, and get directly to the next number position.</p>

<p>Also, the JFormattedTextField must verify if the date entered is valid, and reject it somehow if the date is invalid, or "correct it" to a valid date, such as if the user input "13" as month, set it as "01" and add +1 to the year.</p>

<p>I tried using a mask ("##/##/####") with the validate() method of JFormattedTextField to check if the date is valid, but it appears that those two don't work well together (or I'm too green on Java to know how... :), and then the user can type anything on the field. </p>

<p>Any help is really appreciated! Thanks!</p>

[{'answer_id': 79674, 'author': 'Gero', 'author_id': 13116, 'author_profile': 'https://Stackoverflow.com/users/13116', 'pm_score': 1, 'selected': False, 'text': '<p>try using JCalendar</p>\n'}, {'answer_id': 83024, 'author': 'Spyder', 'author_id': 7546, 'author_profile': 'https://Stackoverflow.com/users/7546', 'pm_score': 1, 'selected': True, 'text': '<p>You may have to use a regular JTextField and call setDocument() with a custom document.  I recommend extending PlainDocument, this makes it easy to validate input as the document changes, and add slashes as appropriate. </p>\n'}]
['https://Stackoverflow.com/questions/79662', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14544/']