tags:

views:

312

answers:

1

Using Java swing, what is the string that correspond to a correct email mask when using the MaskFormatter? Is that possible at all to actually use a MaskFormatter for emails?

+1  A: 

As much as it does make sorta sense to use a MaskFormatter, I don't think it is the most logical answer. Because the length of an email address can vary greatly before and after the @ sign. So you could give the MaskFormatter a huge upper limit of 255 * before and after the @ sign, but that would create some hideous code. I would suggest validating the email address on submit or something along those lines. Hope that helps.

daub815