更新时间:2023-02-05 22:32:44
有heightProperty
和widthProperty
.您可以使用这些属性进行绑定,也可以向其添加侦听器.
There are heightProperty
and widthProperty
. You can use these properties for binding, or add listeners to them.
public void start(Stage stage) {
Scene scene = new Scene(new Group(), 300, 200);
stage.setScene(scene);
stage.titleProperty().bind(
scene.widthProperty().asString().
concat(" : ").
concat(scene.heightProperty().asString()));
stage.show();
}
或查看下一个示例: https://***.com/a/9893911/1054140