How to see when a scene gets shown?
david.grieve at oracle.com
Thu Jun 13 06:11:41 PDT 2013
Get the window of the scene and add a handler for the onShownProperty via the setOnShown method. Add a listener to the Scene's windowProperty and add/remove your handler there.
On Jun 13, 2013, at 8:19 AM, Pedro Duque Vieira <pedro.duquevieira at gmail.com> wrote:
> Hi Werner,
> Thanks for your input but unfortunately this is not the case.
> I want something to happen as soon as the app gets shown to the user.
> Everything is already attached to a scene but the scene has not yet become
> I remember java3D had an event that you could listen to, I think it was
> called something like "isLive" for when a scene was shown.
> Thanks, regards,
>> I have had cases where I would use a Node.sceneProperty listener to
>> delay some initializations which depend on a scene. It is not exactly
>> what you are asking but maybe this is one of those cases, too.
> On 13.06.2013 00:00, Pedro Duque Vieira wrote:
>> On my swing/javafx app - javafx scene embedded in a swing app, I need to
>> know when the scene gets shown to the user or becomes visible. Or when the
>> same happens to a node.
>> I've glanced through the API but have not found a way to do it. Does
>> know how?
> Pedro Duque Vieira
More information about the openjfx-dev