我有一个有很多BorderPanes作为窗口的FlowPane。当FlowPane为空时,我希望显示诸如水印或标签<empty>之类的内容。
有什么解决方案吗?
发布于 2014-04-06 04:29:01
你有没有尝试过这样的东西:
FlowPane flowPane = ... ;
StackPane container = new StackPane();
Label placeHolder = new Label("No content in flow pane");
placeHolder.visibleProperty().bind(Bindings.isEmpty(flowPane.getChildren()));
container.getChildren().addAll(flowPane, placeHolder);然后,很明显,只需将容器添加到您之前添加流窗格的UI中。
https://stackoverflow.com/questions/22880244
复制相似问题