简体   繁体   中英

What is the mask for emails using swing's MaskFormatter

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM