0
一个问我问了好几百次但我知道没人知道如何去做。JavaFX FXML组件填充父项 - 比如Android中的alignParent
我有一个BorderPane,并希望将画布作为BorderPane的底部。我希望画布填充整个底部。我不想硬编码任何值。 它甚至有可能吗?
在Android中我有类似alignParentTop等东西。在JavaFX中这真的不直观。
<BorderPane fx:controller="pl.mg.checkers.controller.GameController"
xmlns:fx="http://javafx.com/fxml">
<top>
<HBox>
<Button fx:id="leaveButton" text="Leave"/>
</HBox>
</top>
<bottom>
<Canvas fx:id="canvas"/>
</bottom>
</BorderPane>
可能的重复:http://stackoverflow.com/questions/23449932/javafx-resize-canvas-when-screen-is-resized – Itai