Reputation: 177
In Java docs says: (About Pane (JavaFX))
Pane resizes each managed child regardless of the child's visible property value;
How to disable this resize?
Upvotes: 0
Views: 675
Reputation: 209684
Call setManaged(false)
on the nodes you do not want to be managed by the pane.
If you want nodes not to take up space when you set visible to false, you can bind the managed property to the visible property:
myNode.managedProperty().bind(myNode.visibleProperty());
Upvotes: 2