0

A question asked a hundred times I know but nobody seems to know how to do this.

I have a BorderPane and want to put Canvas as bottom of the BorderPane. And I want the Canvas to fill the whole bottom. I don't want to hardcode any values. Is it even possible?

In Android I have something like alignParentTop etc. It's really unintuitive here in 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>
Greyshack
  • 1,901
  • 7
  • 29
  • 48
  • Possible duplicate: http://stackoverflow.com/questions/23449932/javafx-resize-canvas-when-screen-is-resized – Itai Dec 29 '15 at 16:57

1 Answers1

0

The problem is that Canvas is not resizable. See here for discussion and solution.

Itai
  • 6,641
  • 6
  • 27
  • 51