How to "apply" skin?

Tomas Mikula tomas.mikula at
Sun Feb 8 23:44:20 UTC 2015

Hello list,

after adding a node to the scene graph, how do I "apply" the skin to
it, in case it is a Control? Something like an equivalent of
applyCss() for skins.

My use case is this:
I add a node to the scene, and want to know its preferred width. So I
call node.applyCss() to make sure CSS is applied, and then call
node.prefWidth(-1). But for a (non-empty) Label, this still returns
0.0, presumably because there is no skin yet.

I don't want to set a concrete skin using
node.setSkin(node.createDefaultSkin()), because I want the node to
have whatever skin would be applied to it, which could be different
from the default skin.


More information about the openjfx-dev mailing list