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
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 .