Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JTextPane当我在文本窗格中输入任何超出指定范围的值时,如何验证 a ?我想将文本窗格更改为红色以指示用户没有输入正确的值,用户应再次在文本窗格中输入值。
JTextPane
我如何验证这一点?
这种情况可能需要JFormattedTextField. 有关更多详细信息和工作代码,请参阅教程中的如何使用格式化文本字段。
JFormattedTextField