如何固定边框节点?

How to make node of borderpane fixed?

如 javafx docs for borderpane 所述 here,

If the window is smaller than the space needed for the contents of each region, the regions might overlap. The overlap is determined by the order in which the regions are set. For example, if the regions are set in the order of left, bottom, and right, when the window is made smaller, the bottom region overlaps the left region and the right region overlaps the bottom region.

我有顶部和底部窗格,它们是从 fxml 预定义的,还有一个由以编程方式更新的 ImageView 组成的中心窗格。我需要始终显示顶部和底部窗格。但是,当我调整应用程序 window 大小时,顶部窗格消失了。据我了解,这是因为中心窗格是最后更新的(根据文档)。如何设置此元素固定?我试图在我的 fxml 文件中设置 minHeight="100.00",但这不起作用。

确保在 FXML 文件的中心之后定义顶部和底部区域:

<BorderPane>
  <center><!-- ... --></center>
  <top><!-- ... --></top>
  <bottom><!-- ... --></bottom>
</BorderPane>