After a long period of searching for my problem, I have no other idea, I have to ask here.
I search for a method to read the console output or System.out
to a JavaFX TextArea
but I don't know how I get those strings.
I want to put that into an external Thread
:
package Threads;
import Core.Engine;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Scanner;
public class ConsoleListenerThread implements Runnable {
Engine engine;
public ConsoleListenerThread(Engine engine) {
this.engine = engine;
}
@Override
public void run() {
String line;
while (true){
}
}
}
Update:
I really need the console output...what you see when you start a program. And how I get there is unnecessary I think (Startup etx), because I just want a String
whenever the console prints a new output.
Example:
System.out.println("Hello");
And then my thread revive this string:
"hello"