How to "apply" skin?

Tomas Mikula tomas.mikula at
Sun Feb 8 23:51:21 UTC 2015

Actually, I want skins to be applied in the whole sub-tree of a node.
The node itself may not be a control, but it may contain controls.

On Sun, Feb 8, 2015 at 6:44 PM, Tomas Mikula <tomas.mikula at> wrote:
> 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.
> Thanks,
> Tomas

More information about the openjfx-dev mailing list