Hello Everybody,
I would like to use java SystemTray functionality with JavaFX application. So, I implemented TrayIcon with MouseListener. My FX-Application started but primary stage is not visible. Then I want to show/hide my FX-Stage by clicking mouse on TrayIcon.
Because I can call stage.show()/hide() from FX thread only I use Platform.runLater( fxTread ). Something like this:
Platform.runLater( new Runnable()
{
public void run()
{
if( stage.isShowing() )
{
stage.hide();
}
else
{
stage.show();
}
}
} );
It works, but one time only. Just show and hide. Looks like the Platform.runLater( thread ) doesn’t finish FX- thread and it is unavailable any more to manipulate the visibility of stage.
Is there a way how to do it?
Thank you.