0
由於某種原因,textExampleTwo.setLayoutX(40)
實際上並不導致Text
完全向右移動。這是一個錯誤還是我錯過了一些重要的東西?.setLayoutX()不影響FlowPane中的位置
public void start(Stage stage) throws Exception {
FlowPane flowPane = new FlowPane();
flowPane.setOrientation(Orientation.VERTICAL);
Text textExampleOne = new Text("An example - 1");
Text textExampleTwo = new Text("An example - 2");
textExampleTwo.setLayoutX(40.0);
flowPane.getChildren().addAll(textExampleOne, textExampleTwo);
Scene applicationScene = new Scene(flowPane);
stage.setHeight(400.0);
stage.setWidth(400.0);
stage.setScene(applicationScene);
stage.show();
}
啊,感謝您的幫助!還有一件事我想問一下,你也可以爲一個窗格做這個嗎? –
取決於窗格的種類... – fabian