简体   繁体   English

如何直接写到JTextArea?

[英]How to write directly to a JTextArea?

I want to write some text into a JTextArea . 我想将一些文本写入JTextArea I think the answer is to extend java.io.Writer , but I'd like an authoritative answer here; 我认为答案是扩展java.io.Writer ,但我想在这里提供权威的答案; is that the right thing to do? 那是正确的事吗?

您可以只使用JTextArea.setText(String)JTextArea.append(String)来做到这一点。

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

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