Hey guys I am making a terminal application using Swing and Apache Commons. I was able to redirect System.out
and System.err
to a JTextArea>
You need to create your own implementation of an InputStream
that takes its input from whatever Swing component you want… basically have a buffer that you copy text to from your Swing component and that serves as a source for the InputStream
(which of course needs to block if no input is available).