Re: How to see when a scene gets shown?

2013-06-13 Thread Artem Ananiev
On 6/13/2013 6:22 PM, Pedro Duque Vieira wrote: Hi David, But does that work for a scene that's embeded in a JXPanel? I would think there is no window in this case or is JXPanel the window? There is a window. It's not a regular top-level window, though. It's implicitly shown/hidden by JFXPan

Re: How to see when a scene gets shown?

2013-06-13 Thread Werner Lehmann
Yes, that's what I meant before: sceneProperty().addListener(new InvalidationListener() { @Override public void invalidated(Observable arg0) { Scene s = getScene(); if (s != null) { s.windowProperty().addListener(new InvalidationListener()

Re: How to see when a scene gets shown?

2013-06-13 Thread Pedro Duque Vieira
Hi David, But does that work for a scene that's embeded in a JXPanel? I would think there is no window in this case or is JXPanel the window? Thanks. Regards, On Thu, Jun 13, 2013 at 2:11 PM, David Grieve wrote: > Get the window of the scene and add a handler for the onShownProperty via > the s

Re: How to see when a scene gets shown?

2013-06-13 Thread David Grieve
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 wrote: > Hi Werner, > > Thanks for your input but unfortunately thi

Re: How to see when a scene gets shown?

2013-06-13 Thread Pedro Duque Vieira
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 "live". I remember java3D had an event that you could listen to, I think it was

Re: How to see when a scene gets shown?

2013-06-13 Thread Werner Lehmann
Pedro, 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. Werner On 13.06.2013 00:00, Pedro Duque Vieira wrote: Hi, On my swing/javafx app -

How to see when a scene gets shown?

2013-06-12 Thread Pedro Duque Vieira
Hi, 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 anyone know how? Cheers, -- Pedro Duque Vieira