JavaFX Panel inside Panel auto resizing

前端 未结 6 408
悲&欢浪女
悲&欢浪女 2020-12-04 14:32

I have a JavaFX application which has only one FXML file. In this file I have one AnchorPane which has a StackPane inside it. Here is the screenshot:

6条回答
  •  有刺的猬
    2020-12-04 14:54

    I was designing a GUI in SceneBuilder, trying to make the main container adapt to whatever the window size is. It should always be 100% wide.

    This is where you can set these values in SceneBuilder:

    AnchorPane Constraints in SceneBuilder

    Toggling the dotted/red lines will actually just add/remove the attributes that Korki posted in his solution (AnchorPane.topAnchor etc.).

提交回复
热议问题