Threading and Node.lookup

Philipp Dörfler phdoerfler at gmail.com
Tue Mar 19 16:45:14 PDT 2013


Ok, threading aside: Where's my mistake?

https://gist.github.com/phdoerfler/5201162

~ philipp

Am 20.03.2013 um 00:30 schrieb Kevin Rushforth <kevin.rushforth at oracle.com>:

>> 
>> 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