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.
如何清理或删除 JTextArea 中的第一行?
到目前为止我用过
int start = 0; int end = 131; area.replaceRange (null, start, end);
但它也已过时,因为 JTextArea 文本的方法是动态的,所以这不好。
利用:
int end = textArea.getLineEndOffset(0) textArea.replaceRange("", 0, end);