Binding is a one-to-many relation

Any property can be observed as many times as you want:

Label lblWidth = new Label();Label lblWidth2 = new Label();lblWidth.textProperty().bind(stage.widthProperty().asString());lblWidth2.textProperty().bind(stage.widthProperty().asString());

But, any consecutive call for the bind() method will override the previous one:

lblWidth.textProperty().bind(stage.widthProperty().asString());lblWidth.textProperty().bind(stage.heightProperty().asString()); // now lblWidth listens for height and ignores width

Don't be disappointed by this rule. You can call bind() effectively only once, right. But, the parameter of bind() can be much more complex than just one property. We'll discuss this in more detail in the Using ...

Get Mastering JavaFX 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.