我有一个使用Pane和Path和Label对象的工作映射。我将几个路径和标签对象放置到窗格上。Path对象代表国家,标签对象代表它们的大写。所以它显示了一个国家,中间是一个标签,标签上绑定了一个字符串对象。
count.textProperty().bind(system.getNations().get(nameNoSpace).getTroopCount().asString());当使用BorderPane而不是窗格时,Label对象突然停止显示?
知道原因是什么吗?
BorderPane在隐藏标签吗?
谢谢
发布于 2016-02-21 14:59:35
不能使用BorderPane方法将子级添加到root.getChildren().add(node)中。若要向BorderPane添加对象,需要使用其他方法,如
setCenter(node);
setTop(node);
setBottom(node);
setLeft(node);
setRight(node);有关更多信息,请参见BorderPane文档。
如果需要使用getChildren().add()方法,可以在BorderPane的中心插入一个窗格,并在窗格中添加国家。
https://stackoverflow.com/questions/35536916
复制相似问题