In order to add a grid layout to an JavaFX Application window, you have to instantiate the class GridPane.
An object of this class is tehn added to a Scene of an Applications Stage.
I have to admit that JavaFX looks much nicer than Swing even without applying any customizing using CSS.
The fucntion setPadding of the GridPane is setting the space between the components and the layout GridPane. The spaces are set from left to right for top, right, bottom and left sides of a GridPane.
Methods setHgap and setVgap are determining the space between nodes within a GridPane.
The example above is taken from the Oracle Java Tutorials.