Waiting to repaint the scene

advertisements

Is there any possible way to wait for the scene to repaint?

My problem is, that i want to add a Note to a Pane with getChildren().add() and then to fire an event on this Node with Node.fireEvent(event).

But the event is not performed. I think the problem is, that the scene was not repainted at the point of the fireevent and so the Node is not a part of the new Scene at this time.

So the best way would be to wait for the scene to repaint and then fire the event i think.


I do not know which is the UI Component you has been used here, but, try to find out the invalidate() method (or something like that) of your component to make it update the screen after all.