My understanding is setManaged flag should exclude it from being laid out and computed pref/min/max size. However it worked consistently for Parent but not for Control. In SkinBase.java, computeXxxWidth/Height etc methods checked if the child is managed which is correct. But in layoutChildren method, it will layout all the children anyway. A quick fix would be add " if(child.isManaged())" below.
protected void layoutChildren(final double contentX, final double contentY,
final double contentWidth, final double contentHeight) {
// By default simply sizes all children to fit within the space provided
for (int i=0, max=children.size(); i<max; i++) {
Node child = children.get(i);
if(child.isManaged()) layoutInArea(child, contentX, contentY, contentWidth, contentHeight, -1, HPos.CENTER, VPos.CENTER);
}
}
protected void layoutChildren(final double contentX, final double contentY,
final double contentWidth, final double contentHeight) {
// By default simply sizes all children to fit within the space provided
for (int i=0, max=children.size(); i<max; i++) {
Node child = children.get(i);
if(child.isManaged()) layoutInArea(child, contentX, contentY, contentWidth, contentHeight, -1, HPos.CENTER, VPos.CENTER);
}
}