public boolean verify(JComponent input) {
        boolean allow = true;
        if (input instanceof JFormattedTextField) {
            JFormattedTextField textField = (JFormattedTextField)input;
            AbstractFormatter formatter = textField.getFormatter();
            if (formatter != null) {
                String value = textField.getText();
                if (value.length() != 0) {
                    try {
                        formatter.stringToValue(value);
                    } catch (ParseException exc) {
                        allow = false;
                    }
                } else if (!optionalField) {
                    allow = false;
                }
            }
        }

        return allow;
    }