How do I create a Swing console window that displays System.out/err while a program is running?
I have an application that uses a lot of System.out status updates that I'd like to migrate out of Eclipse and into a self-contained .jar. I've been attempting to create a "Console Window", which would display System.out and System.err. I used this link as a jump-off point, and while it works fine with the GUI application that the program starts with, as soon as I start the thread that runs the meat of the application, the console window stops updating. I tested redirecting system.out to a file and that worked fine, so I'm confused as to what I might be doing wrong. Essentially, I have a couple main stages of the program.
- Program start. Console initializes fine, works until I call the thread.
- GUI init. Same.
- Initial Logic run. Same.
- In the thread where everything seems to stop working: The JTextArea never actually loads - the window is created but the contents are just a copy of whatever was behind the window at the time, and no text is written