Simple equivalent to display: none?

Scott Palmer swpalmer at gmail.com
Wed Jul 22 13:59:18 UTC 2015


Just do:  node.managedProperty().bind(node.visibleProperty());

Then the visible property controls both.


Scott

> On Jul 22, 2015, at 8:33 AM, Mike Hearn <mike at plan99.net> wrote:
> 
> One common layout task that seems harder than necessary in JavaFX is to
> temporarily remove a node from the scene graph, without having to actually
> mess about with the parent container. In HTML you can do use #foo {
> display: none; } to hide something temporarily. In JFX you have to remove
> from the parent container's child nodes list, and then remember where it
> was so it can be put back later.
> 
> The visible property is nearly good enough except that it doesn't affect
> layout. Setting both visible and managed to false can sometimes work but
> seems indirect.
> 
> Is there any appetite for a boolean display property that makes layout
> managers ignore/skip the child and also makes it invisible?



More information about the openjfx-dev mailing list