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 (Stri
You'll have to redirect System.out
to a custom, observable subclass of PrintStream
, so that each char or line added to that stream can update the content of the textArea (I guess, this is an AWT or Swing component)
The PrintStream
instance could be created with a ByteArrayOutputStream
, which would collect the output of the redirected System.out