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.
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.
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.
And the swing memo can deal with big strings, more than 500kb or more than 1MB?
Because the entire result printed in the sdtout in my ID is really huge.
Thx
See Message Console, for which the description states:
Message Console Screenshot
The
JTextPaneform of Message Console inappendmode.(Screenshot obtained from the linked article at Rob Camick’s ‘Java Tips Weblog’.)