62,628
社区成员
发帖
与我相关
我的任务
分享 // 重载父类的insertString函数
public void insertString(int offset, String str, AttributeSet a)
throws BadLocationException {
if (getLength() + str.length() > len) {// 这里假定你的限制长度为10
return;
} else {
super.insertString(offset, str, a);
}
}