Threading and Node.lookup
Scott Palmer
swpalmer at gmail.com
Tue Mar 19 16:53:05 PDT 2013
My guess is drop the "#". That's a CSS thing and not part of the ID.
Scott
On 2013-03-19, at 7:50 PM, Kevin Rushforth <kevin.rushforth at oracle.com> wrote:
> One of the scene graph or FXML folks should be able to reply.
>
> -- Kevin
>
>
> Philipp Dörfler wrote:
>> 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