JavaFX freezing issue

孤人 提交于 2019-12-05 19:24:26
jewelsea

You want to use an AnimationTimer or Timeline, not a java.util.Timer. An AnimationTimer or Timeline executes it's code on the JavaFX Application Thread, whereas a java.util.Timer does not. With a java.util.Timer you will encounter random issues related to thread race conditions. You can use Platform.runLater in combination with a java.util.Timer, but, in general, using an AnimationTimer is the preferred way of handling this.

See related question:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!