我如何创建一个窗格并将一个孩子Node
放在中心?
让我们说Pane
is 500
by500
和 the Node
is an ImageView
with a 200
by200
Image
ImageView view = new ImageView();
Image img = new Image("test.png");
view.setImage(img);
Pane pane = new Pane();
pane.setMinWidth(500);
pane.setMinHeight(500);
pane.getChildren().add(view);