官术网_书友最值得收藏!

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 binding operations section.

主站蜘蛛池模板: 称多县| 淳化县| 康平县| 屯昌县| 广德县| 荃湾区| 临洮县| 曲麻莱县| 泰兴市| 夏津县| 阳泉市| 信宜市| 疏勒县| 襄垣县| 洪洞县| 孟州市| 江安县| 蓝田县| 绥江县| 日土县| 无棣县| 仙游县| 定西市| 凤阳县| 稻城县| 高邮市| 娄烦县| 荔浦县| 西吉县| 壤塘县| 桂阳县| 麻江县| 怀集县| 余姚市| 西畴县| 招远市| 西畴县| 大厂| 黄浦区| 高邮市| 塔城市|