首先,我是JavaFX的新手,很抱歉,如果这个问题很愚蠢。 如何从任务中获取返回对象?
继承我的问题:
我想从模拟中获取一个对象列表。 模拟的延迟时间为1到5秒。 但我不想要,我的GUI在这个时候冻结了。
在Java.Swing中,使用Thread很容易,但就我所知,JavaFX具有Tasks。
我已经阅读了很多教程,但他们返回的文本属性。 所以这是我的问题:如何使用任务/线程(在我的情况下为List)中的计算结果设置Object的值
谢谢。
First of all I'm new at JavaFX, so sorry if this question is stupid. How can I get an return Object from a Task?
Heres my Problem:
I want to get a List of Objects from a Mock. The Mock has a delay from 1 up to 5 seconds. But I dont want, that my GUI freeze in this time.
In Java.Swing it was easy with an Thread, but JavaFX has, as far as I know, Tasks.
I've read much tutorials, but everywhere they return a text property. So here is my question: how can I set the value of an Object with the result of the calculation from a Task/Thread (in my case a List)
Thank you.
更多推荐
发布评论