我想通过 Jframe 中的 JButton 删除一行。 但我不知道如何... 我已经尝试过:
public void button1_ActionPerformed(ActionEvent evt) {
int count = 1;
count = TextArea1.getLineCount();
但是它不起作用... 我感谢各种帮助:)) 或者有人知道解决这个问题的另一种方法吗?
最佳答案
您需要使用 GetText() 获取 TextArea 中已有的内容,然后删除该行。修改文本后,您可以使用 SetText() 将其恢复。
当然,这可以在一行中完成,但分隔步骤有助于易读。
关于java - 通过 TextArea 中的 JButton 删除单行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21686146/