如何防止用户在“JTextField”中输入某些字符,并且如果输入该字符,则不将其显示在文本字段中
最佳答案
您可以使用 JFormattedTextField 或创建自定义 DocumentFilter .
关于java - 如何过滤JTextField中的某些字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15703644/
标签 java swing jtextfield
如何防止用户在“JTextField”中输入某些字符,并且如果输入该字符,则不将其显示在文本字段中
最佳答案
您可以使用 JFormattedTextField 或创建自定义 DocumentFilter .
关于java - 如何过滤JTextField中的某些字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15703644/