前几天用javafx做小桌面应用程序出现了一个问题:
反复检查,最终确定报错的原因是UI刷新频率过快导致的
javafx提供了Platform.runLater用于解决该问题:文章来源:https://www.toymoban.com/news/detail-682614.html
Platform.runLater(new Runnable()
{
@Override
public void run()
{
//用Platform.runLater来运行需要高频调用的方法
documentTextArea.setText(documentString);
}
});
总结:需要高频调用方法使用Platform.runLater文章来源地址https://www.toymoban.com/news/detail-682614.html
到了这里,关于javafx应用程序线程异常Exception in thread “JavaFx Application Thread“的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!