1
を参照せずにアンバインドプロパティI次のコードを持っている:私は動作しないアンバインドのJavaFX:プロパティ
textField1.textProperty().unbind();
と交換THIS LINE
場合
@Override
public void start(Stage stage) throws Exception {
TextField textField1=new TextField();
SimpleStringProperty property=new SimpleStringProperty("Initial Value");
textField1.textProperty().bindBidirectional(property);
Button but1=new Button("New value");
Button but2=new Button("Unbind");
but1.setOnAction((event)->{
property.set("New Value");
});
but2.setOnAction((event)->{
//THIS LINE
});
VBox vbox=new VBox();
vbox.getChildren().addAll(textField1,but1,but2);
Scene scene=new Scene(vbox, 200, 400);
stage.setScene(scene);
stage.show();
}
問題はあるが。しかし、私が
と置き換えた場合textField1.textProperty().unbindBidirectional(property);
アンバインド作業。
私は多くのプロパティを持ち、参照を保持したくありません。 textField1またはtextField1.textProperty()からプロパティを取得できますか?または、他の方法でバインドを解除することは可能ですか?property