This is a bug in the Stage class that is fixed in JavaFX 8.0 (which is available in the current Java 8.0 EAP release).
Note that the resizableProperty is actually correctly set when binded bidirectional, the set value has only no effect.
My testing:
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class StageResizableTest extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(final Stage stage) throws Exception {
Button button = new Button("resize");
button.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
stage.setResizable(true);
}
});
Button button2 = new Button("not resize");
button2.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
stage.setResizable(false);
}
});
CheckBox checkBox = new CheckBox("Resizable");
checkBox.selectedProperty().bindBidirectional(stage.resizableProperty());
checkBox.selectedProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observableValue, Boolean aBoolean, Boolean aBoolean2) {
System.out.println("checkbox changed from "+aBoolean+" to "+aBoolean2);
}
});
stage.resizableProperty().addListener(new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observableValue, Boolean aBoolean, Boolean aBoolean2) {
System.out.println("stage resizable changed from "+aBoolean+" to "+aBoolean2);
}
});
Button button3 = new Button("request stage resizable");
button3.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
System.out.println(stage.resizableProperty().get());
}
});
VBox box = new VBox();
box.getChildren().addAll(checkBox, button, button2, button3);
Scene scene = new Scene(box, 500, 500);
stage.setScene(scene);
stage.show();
}
}