JavaFX: FXML: How to make the child to extend its size to fit the parent pane?

前端 未结 6 1295
广开言路
广开言路 2020-12-14 08:18

I have managed to load a child fxml(sub UI) under a parent fxml (mainMenu UI). I have created an AnchorPane with id \"mainContent\". This pane is bound to 4 sides and change

6条回答
  •  庸人自扰
    2020-12-14 08:44

    With the look at the structure of your interface I guess you better use BorderPane as your parent container with this suggestion don't use AnchorPane directly inside the BorderPane container here is my suggestion you do:

    ->BorderPane-Top = "your menu"

    ->BorderPane-Center = another container (could be SplitPane, another BorderPane etc.. but not AnchorPane I guess but you can try if you want)

    ->BorderPane-Bottom = another container (could be hbox with buttons or label for info or notifications etc..)

提交回复
热议问题