【问题标题】:What is the mask for emails using swing's MaskFormatter使用 swing 的 MaskFormatter 的电子邮件掩码是什么
【发布时间】:2010-09-17 05:37:40
【问题描述】:

使用 Java swing,在使用 MaskFormatter 时,对应于正确电子邮件掩码的字符串是什么? 真的可以将MaskFormatter 用于电子邮件吗?

【问题讨论】:

    标签: java swing mask


    【解决方案1】:

    尽管使用 MaskFormatter 确实很有意义,但我认为这不是最合乎逻辑的答案。因为电子邮件地址的长度在@ 符号之前和之后可能会有很大差异。因此,您可以在 @ 符号前后给 MaskFormatter 一个巨大的上限,即 255 *,但这会产生一些可怕的代码。我会建议validating the email address 提交或类似的东西。希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-17
      • 2013-04-18
      • 2012-12-31
      • 2015-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多