I have the following scenario:
A log in screen appears to the user
The user will tries to login
A javafx task will start to communicate with the server.
While the communication works on behind, an indeterminate progress bar will be shown to the user (this called from the main thread).
If the login credentials are correct, an OTP message will be sent to the user mobile.
An OTP dialog (javafx stage) will be shown, and the user should enter the OTP received (The main thread should wait until it gets this OTP then can continue processing).
Unfortunately, I faced many problems with this, as the following:
1 - Currently the OTP dialog called from the background communication thread through Platform.runLater, but the main thread continue running without waiting the OTP.
How can I accomplish this task?????