简体   繁体   English

过滤AWT文本字段输入文本

[英]filtering AWT textfield input texts

In jtextfield, One can restrict the inputs of an jtextfield by overriding the insertString method of document. 在jtextfield中,可以通过覆盖document的insertString方法来限制jtextfield的输入。 How can i do these in awt textfield? 我如何在awt文本字段中执行这些操作? How can i filter the inputs of an awt textfield? 如何过滤awt文本字段的输入?

One can restrict the inputs of an jtextfield by overriding the insertString method of document. 可以通过重写document的insertString方法来限制jtextfield的输入。

jtextfield by overriding the insertString method of document. jtextfield通过覆盖文档的insertString方法。

  • maybe you need to use DocumentFilter for Swing JTextComponent s 也许您需要对Swing JTextComponent使用DocumentFilter

How can i do these in awt textfield? 我如何在awt文本字段中执行这些操作? How can i filter the inputs of an awt textfield? 如何过滤awt文本字段的输入?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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