I'm using FXML with JavaFX to develop graphical interfaces. I discovered this method for binding the width/height of a child node to the width/height of it's parent node:
<Node fx:id="parent">
<children>
<Node prefWidth=${parent.width}></Node>
<children>
</Node>
But that feels inelegant. I'd rather not have to give an id to a node just so it's child can reference it's dimensions. Is there perahps some method for referenceing the parent
of a node? Maybe something like prefWidth=${parent.width}
?
NOTE: I know this can be done programmatically from Java, but that's not what I want here. I'm looking for a way to do this in the FXML.