【发布时间】:2013-11-04 00:22:52
【问题描述】:
Java FX 应用程序线程有问题。这是一个伪代码:
showMenu();
//Contoller which waits for action(pressing button)...
showLoadingPic();
Thread.sleep(2000);
showMap();
问题是在showMenu()中显示的窗口出现休眠,showLoadingPic()根本没有显示,最后在showMap()中显示窗口。
showLoadingPic 中的场景有一个运行 2 秒的进度条,与 Thread.sleep(2000) 的时间相同。
所以看起来 javafx 应用程序线程块 showLoadingPic() 和 showLoadingPic() 在后台运行。
有人可以帮我解决这个问题吗?
提前谢谢你!
【问题讨论】:
标签: multithreading javafx thread-sleep