Formtext FormTextMask

MaskFormatter fmt = null;

// A phone number
try {
    fmt = new MaskFormatter("###-###-####");
} catch (java.text.ParseException e) {
}
JFormattedTextField tft1 = new JFormattedTextField(fmt);


// A social security number
try {
    fmt = new MaskFormatter("###-##-####");
} catch (java.text.ParseException e) {
}
JFormattedTextField tft2 = new JFormattedTextField(fmt);

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.