Threading and Node.lookup

Kevin Rushforth kevin.rushforth at oracle.com
Tue Mar 19 16:30:36 PDT 2013


>
> As to my understanding, one only has to use Platform.runLater for accessing nodes already attached to a Scene.

In general is is legal to call accessor and mutator methods on a Node 
not attached to a Scene from any thread. I don't specifically know 
whether lookup does anything that would add additional threading 
restrictions.

-- Kevin


Philipp Dörfler wrote:
> Hi,
>
> does fooNode.lookup("#bar") have to be called using Platform.runLater if fooNode is not attached to any Scene?
> As to my understanding, one only has to use Platform.runLater for accessing nodes already attached to a Scene.
>
> However, fooNode.lookup seems to fail (= return null) for nodes which are not contained directly in it, but in another node (in my case: a ScrollPane), which is then contained in fooNode. The scene graph was provided by FXMLLoader.load(...).
>
> Placing those lookups in Platform.runLater suddenly causes them to work.
>
> This feels like an arcane bug to me, but I might be missing some core concepts.
> So - did I miss something or is this a bug?
>
> Cheers,
> Philipp


More information about the openjfx-dev mailing list