Event for when a node gets shown on screen

anton nashatyrev anton.nashatyrev at oracle.com
Wed Oct 2 03:58:38 PDT 2013


Hi Pedro,

     that binding is 'watching' for the whole chain of properties and is 
changed to 'true' only when the node is attached to the scene, the scene 
is attached to the window and the window isShowing() = true. Vice verse 
it changed to 'false' if any of the above conditions becomes false, i.e. 
node or scene is detached or window is hidden.

Regards,
Anton.

On 01.10.2013 23:37, Pedro Duque Vieira wrote:
> Hi Anton,
>
> If I understand correctly (never used the Bindings.select method) 
> you're listening to the node scene property and at the same time if 
> the window that owns the scene is showing, that is, if the stage is 
> visible on screen?
>
> Thanks, best regards,
>
>     Hi Pedro,
>        you may try the following code:
>     Bindings.select(node.sceneProperty(), "window",
>     "showing").addListener(new ChangeListener<Boolean>() ....);
>     BTW, this way you could add the listener even when the node is not yet
>     attached to any scene or window.
>     Regards,
>     Anton.
>
>
> -- 
> Pedro Duque Vieira



More information about the openjfx-dev mailing list