I have a problem with Java FX application thread. Here is a pseudo-code:
showMenu();
//Contoller which waits for action(pressing button)...
showLoadingPic();
Thread.sleep(2000);
showMap();
The problem is that the sleep occurs in window which is displayed in showMenu(), showLoadingPic() is not shown at all, and at the end window in showMap() is shown.
The scene in showLoadingPic has a progress bar which runs 2 secs which is the same time as Thread.sleep(2000).
So it seems like javafx application thread blocks showLoadingPic() and showLoadingPic() runs at background.
Can somebody help me to fix this??
Thank you in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…