Nick Nick
Nick Nick

Reputation: 177

Disable autosize in Pane

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

Answers (1)

James_D
James_D

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

Related Questions