I'm making a JavaFX application in which I read a problem and generate a solution when the start button is pressed. The problem is that when I click the start button, the GUI hangs. I looked at this post which suggests to wrap the thread-safe method in Platform.Runlater.
Now when the button is clicked, the method doBtnStartPressed() in my controller is called. This method only contains the call to the showSolution() method. Then I wrapped the content of this method in the Platform.runLater as follows:
private void showSolution() {
Platform.runLater(new Runnable() {
public void run() {
// solve problem
// draw solution on panes (rectangles which represent time windows)
}
});
}
This however doesn't work.