My JavaFX app's UI freezes after consecutive times of executing webservice calls. Those process calls are asynchronous.
How do I fix this problem? Is there a way to "unfreeze" the UI?
Sorry for the newbie question. But I badly need anyone;'s help
My JavaFX app's UI freezes after consecutive times of executing webservice calls. Those process calls are asynchronous.
How do I fix this problem? Is there a way to "unfreeze" the UI?
Sorry for the newbie question. But I badly need anyone;'s help
Did you create a thread to execute it? JavaFX is executed on the EDT (event dispatch thread). That is why you experience GUI freeze. Here is what you do
import javafx.async.*
public class MyWebService extends RunnableFuture {
public var webserviceURL:String;
override run(): Void {
// your web service
}
}
public class MyWebServiceTask extends JavaTaskBase {
override create(): RunnableFuture {
return MyWebService {
webserviceURL: "http://...."
};
}
}
def webserviceTask: MyWebServiceTask = MyWebServiceTask { }
webserviceTask.start();