What kind of thread did you use ?
in JavaFX you have to Use the Service classe to do the things correctly and don't make freez the GUI stuff.
On this service you have an onSucceeded field, so if you listen it you can do what you want when it have finished to work.
You can laso take a look a this
And if you want nice dialogs take a look at ControlFX