JavaFX screen resolution scaling

后端 未结 1 968
太阳男子
太阳男子 2021-02-13 12:44

I have been searching for a method to do this, but I only found This question without answers.

I am developing in a 1366x768 laptop, I use JavaFX to create a GUI (I am s

1条回答
  •  有刺的猬
    2021-02-13 13:18

    You need to set anchor pane constraints on child. in your case gridpane

    AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
    

    This will go after your

     GridPane prefHeight="300.0" prefWidth="400.0" **HERE** 
    

    This will maximize Child component within container , hence 0 0 0 0 pixels from each side .

    0 讨论(0)
提交回复
热议问题