Geraldo,
O JFormattedTextField possui uma política de validação para usar a máscara.
Caso o valor entrado não corresponda totalmente à mascara, o campo voltará ao valor anterior quando perder o foco.
Mas isso pode ser alterado, usando o método setFocusLostBehavior(int)
Existem 4 comportamentos, segundo a documentação:
JFormattedTextField.REVERT
Revert the display to match that of getValue, possibly losing the current edit.
JFormattedTextField.COMMIT
Commits the current value. If the value being edited isn’t considered a legal value by the AbstractFormatter that is, a ParseException is thrown, then the value will not change, and then edited value will persist.
JFormattedTextField.COMMIT_OR_REVERT
Similar to COMMIT, but if the value isn’t legal, behave like REVERT.
JFormattedTextField.PERSIST
Do nothing, don’t obtain a new AbstractFormatter, and don’t update the value.
The default is JFormattedTextField.COMMIT_OR_REVERT, refer to setFocusLostBehavior(int) for more information on this.
Sendo assim, testa cada um deles, por exemplo.
seuField.setFocusLostBehavior( JFormattedTextField.PERSIST );
Falow!