*
* @param mask specified mask
* @return FormattedTextField with mask
*/
public static JFormattedTextField createFormatterField(String mask) {
MaskFormatter maskFormatter = null;
try {
maskFormatter = new MaskFormatter(mask);
maskFormatter.setAllowsInvalid(true);
} catch (ParseException ex) {
MessageBox.showError("Mask Formatter is bad", ex);
}
JFormattedTextField ftfFormatterField = new JFormattedTextField(maskFormatter);