Still having the same issue, revised source of main app code: http://pastebin.com/fLCwuMVq
There must be something in CoreTest
that bl
Have you tried running it on the UI Thread?
public void write(final int i) throws IOException {
Platform.runLater(new Runnable() {
public void run() {
output.appendText(String.valueOf((char) i));
}
});
}
EDIT
I think your problem is that your run some long tasks in the GUI thread, which is going to freeze everything until it completes. I don't know what
CoreTest t = new CoreTest(installPath);
t.perform();
does, but if it takes a few seconds, your GUI won't update during those few seconds. You need to run those tasks in a separate thread.
For the record, this works fine (I have removed the file and CoreTest bits):
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws IOException {
TextArea ta = TextAreaBuilder.create().prefWidth(800).prefHeight(600).wrapText(true).build();
Console console = new Console(ta);
PrintStream ps = new PrintStream(console, true);
System.setOut(ps);
System.setErr(ps);
Scene app = new Scene(ta);
primaryStage.setScene(app);
primaryStage.show();
for (char c : "some text".toCharArray()) {
console.write(c);
}
ps.close();
}
public static void main(String[] args) {
launch(args);
}
public static class Console extends OutputStream {
private TextArea output;
public Console(TextArea ta) {
this.output = ta;
}
@Override
public void write(int i) throws IOException {
output.appendText(String.valueOf((char) i));
}
}
}