How to redirect all console output to a GUI textbox?

后端 未结 2 1966
无人及你
无人及你 2020-12-08 03:20

I currently have a program that prints lines of text to the screen in various manners such as \'System.out.println()\' statements and for loops the print all elements in an

2条回答
  •  既然无缘
    2020-12-08 04:02

    An idea:

    Create your own PrintStream that outputs everything to this textbox. Then set this new PrintStream to be the standard output stream like that:

    System.setOut(myPrintStream());
    

提交回复
热议问题