Disabling Button while TextFields empty not working
问题 BooleanBinding bb = new BooleanBinding() { { super.bind(addnum.textProperty(),addt1.textProperty(),addt2.textProperty(), addt3.textProperty(),addasg.textProperty(),addatt.textProperty()); } @Override protected boolean computeValue() { return (addnum.getText().isEmpty() && addt1.getText().isEmpty() && addt2.getText().isEmpty() && addt3.getText().isEmpty() && addasg.getText().isEmpty() && addatt.getText().isEmpty()); } }; final Button b2 = new Button("Add"); b2.disableProperty().bind(bb); This