show data on a JTextArea instead of console
问题 I want to have a JTextArea that can completely work instead of a console but I don't know how to do this! Thank you 回答1: The solution to the problem is to redirect System.{in,out,err} to a JTextArea . Starting with System.out it's pretty straight forward to to redirect it to your JTextArea component using System.setOut method. In the example below I've done this using pipes and SwingWorker but that is all fancy stuff to actually get the output simpler to the swing component. Emulating System