Event for when a node gets shown on screen

Martin Sladecek martin.sladecek at oracle.com
Tue Oct 1 07:06:07 PDT 2013


That would work, except you need to hard-ref the binding otherwise it 
might get GCed.

-Martin

On 10/01/2013 02:53 PM, anton nashatyrev wrote:
> 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.
>
> On 29.09.2013 18:57, Pedro Duque Vieira wrote:
>> Hi,
>>
>> More than once or twice I had the need to do something when a node first
>> gets shown on screen. Like for instance do some animation or setup some
>> parameters which are only valid when the node is showing.
>>
>> For this reason I think there is a need for an event that is 
>> triggered when
>> the node becomes live, i.e. is shown on screen.
>>
>> Thanks, best regards,
>>
>



More information about the openjfx-dev mailing list