【发布时间】:2015-05-22 22:00:34
【问题描述】:
标题窗格的子级将其父级(标题窗格)设置得很晚。不像我使用的任何其他 ui 元素。示例代码:
@Override
public void start(Stage primaryStage) throws Exception{
Group root = new Group();
Scene scene = new Scene(root, 300, 275);
primaryStage.setScene(scene);
primaryStage.show();
VBox vbox = new VBox(new Circle(30, Color.RED));
TitledPane titledPane = new TitledPane("circle", vbox);
root.getChildren().add(titledPane);
System.out.println(titledPane.getParent());//parent is set
System.out.println(vbox.getParent());//parent not set
}
虽然 vbox 立即设置了其父级,但标题窗格却没有。这种行为是想要的(作为框架的效果)还是真的只是不一致?
【问题讨论】:
标签: javafx