Hi,
please consider the following code. I am expecting that both Labels are visible, because A || B == B || A, but only the second one is visible:
When I replace ReadOnlyBooleanWrapper with SimpleBooleanProperty it works as expected.
Feels like a bug to me?!
import javafx.application.Application;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanWrapper;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp3 extends Application {
public static void main(String[] args) {
launch(args);
}
private final BooleanProperty first = new ReadOnlyBooleanWrapper(false);
private final BooleanProperty second = new ReadOnlyBooleanWrapper(false);
@Override
public void start(final Stage stage) throws Exception {
Label label1 = new Label("first");
Label label2 = new Label("second");
label1.visibleProperty().bind(first.or(second));
label2.visibleProperty().bind(second.or(first));
first.set(true);
Scene scene = new Scene(new VBox(label1, label2));
stage.setScene(scene);
stage.show();
}
}