Input Masks Summary Table : JFromattedField MaskFormatter « Swing « Java Tutorial






CharacterDescription
#Matches numeric character (Character.isDigit())
HMatches hexadecimal number (0-9, a-f, and A-F)
AMatches alphanumeric character (Character.is LetterOrDigit())
?Matches alphabetic character (Character.isLetter())
UMatches uppercase letter; maps lowercase to uppercase
LMatches lowercase letter; maps uppercase to lowercase
*Wildcard, matches any character
'Escape character to have literal strings/separators in input field










14.19.JFromattedField MaskFormatter
14.19.1.Input Masks Summary Table
14.19.2.Formatted Masked Input: new MaskFormatter(###-##-####)Formatted Masked Input: new MaskFormatter(###-##-####)
14.19.3.Formatted Masked Input: new MaskFormatter((###)###-####) (For phone number)Formatted Masked Input: new MaskFormatter((###)###-####) (For phone number)
14.19.4.Regex Formatter with a JFormattedTextFieldRegex Formatter with a JFormattedTextField
14.19.5.Work with DefaultFormatterFactory
14.19.6.Apply a mask to String