如何将控制台内容重定向到Java中的textArea? [英] How to redirect console content to a textArea in Java?

查看:115
本文介绍了如何将控制台内容重定向到Java中的textArea?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在java中的textArea中获取控制台的内容。

I'm trying to get the content of console in a textArea in java.

例如,如果我们有这个代码,

For example if we have this code,

class FirstApp {
    public static void main (String[] args){
        System.out.println("Hello World");
    }
}

我希望将Hello World输出到textArea,我必须选择什么actionPerformed?

and I want to output the "Hello World" to a textArea, what actionPerformed do I have to choose?

推荐答案

消息控制台显示了一个解决方案。

Message Console shows one solution for this.

这篇关于如何将控制台内容重定向到Java中的textArea?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆