private void updateUI(String text) {
Platform.runLater(new Runnable() {
@Override public void run() {
System.out.println("Updating GUI...");
textBox.setText(text);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
I'm using few threads on my JavaFx project. Those threads are reading some files and my GUI is being updated at the end, even though I'm trying to change it on the way.
I just want to add a delay after every change of my textBox value. But the problem is that the textBox value is not updated after every "Updating GUI..." It's value is being changed just at the end. How can I delay every change in my textBox?
I'm ok with the fact that GUI is updated after my threads are done..but I suspect that the value of the textBox is being changed many times instantly wich I want to change