将System.out.println或stdout数据捕获到摆动备忘录(巨大数据) [英] Capturing System.out.println or stdout data to a swing memo (Huge Data)

查看:115
本文介绍了将System.out.println或stdout数据捕获到摆动备忘录(巨大数据)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用System.out.println而不是在备忘录中显示结果,但是例如,无法将stdout放入列表中,并且在摇摆备忘录中显示此列表的内容之后,因为我需要实时显示或实时显示结果的每一行.

Hi I need to show the result in a memo instead using System.out.println, but isn't possible to put the stdout in a list for example and after display the contents of this list in swing memo because I need to display every line of the result in real time or when it is showed.

我认为它的工作方式类似于System.out.println的观察者,并且在控制台中打印了一些数据或信息后,我希望能够捕获它们并在备忘录中显示.

I'm think in something that works like an observer of System.out.println and when some data or information have been printed in the console I want to be able to capture it and display in a memo.

为了更好地理解,我在UNIX服务器上远程执行了一些命令,并在stdout中检索了这些命令的结果,并用它们计算了一些时间和度量,当然,我需要以这种方式来模拟远程应用程序.

For a better comprehension, I execute some commands remotely in an unix server and retrieve the results of these commands in the stdout and compute some time and metrics with them, and definitely I need to do in this way to simulate the behavior of an remote application.

该解决方案可能是一种在产生备忘录的确切时间中显示备忘录中列表中的每一行或每一项目的方法.

The solution could be a way to show every line or every item in the list in the memo in the exactly time that it is produced.

摇摆备忘录可以处理大于500kb或大于1MB的大字符串吗?

And the swing memo can deal with big strings, more than 500kb or more than 1MB?

因为在我的ID中的sdtout中打印的整个结果确实很大.

Because the entire result printed in the sdtout in my ID is really huge.

Thx

推荐答案

请参见消息控制台,其说明内容如下:

See Message Console, for which the description states:

有时您可能想从程序中捕获输出并将其显示给用户.通常,这是通过创建控制台来完成的.使用Swing,使用JTextArea或JTextPane创建一个简单的控制台并不是很困难.我们的消息控制台将能够显示写入System.out和System.err的输出. ..

There may be times when you want to capture output from your program and display it for the user. This is generally done by creating a console. Using Swing it is not too difficult to create a simple console using a JTextArea or JTextPane. Our message console will be able to display output written to System.out and System.err. ..

消息控制台屏幕截图

append模式下的消息控制台的JTextPane形式.

Message Console Screenshot

The JTextPane form of Message Console in append mode.

(屏幕快照是从Rob Camick的"Java Tips Weblog"上的链接文章中获得的.)

(Screenshot obtained from the linked article at Rob Camick's 'Java Tips Weblog'.)

这篇关于将System.out.println或stdout数据捕获到摆动备忘录(巨大数据)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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