Executing background tasks [message #1772702] |
Thu, 14 September 2017 07:01  |
Eclipse User |
|
|
|
Hi,
what is the recommended way to do some tasks in the background? Do it the 'SWT way'
final ProgressMonitorDialog monitor = new ProgressMonitorDialog(UtilSWT.getShell());
monitor.run(true, true, runnable);
Or the FX way?
new javafx.concurrent.Service(){[..]}.start()
Probably both should work? Are there any pitfalls I should be aware of?
E.g., does it make a difference if the Service/ ProgressMonitorDialog will update an FX component or an SWT component once done?
|
|
|
Re: Executing background tasks [message #1772761 is a reply to message #1772702] |
Thu, 14 September 2017 21:43   |
Eclipse User |
|
|
|
1. First of all I think you are embedding JavaFX into an SWT-UI, right? I would stick with the SWT/Platform way.
2. You can call JavaFX from the SWT-Display-Thread and SWT from the JavaFX-Event-Thread because they are the same!
|
|
|
Re: Executing background tasks [message #1772765 is a reply to message #1772761] |
Thu, 14 September 2017 22:10   |
Eclipse User |
|
|
|
Yes, embedded FX UI..
I thought, since I am anyways working mainly with FX UI elements, I could be more consequent and do this kind of stuff the FX way as well. I will give it a try, thanks a lot!
|
|
|
|
Powered by
FUDForum. Page generated in 0.04948 seconds