Setting the gaps between components and rows explicitly by calling the setHgap() : FlowLayout « Swing « Java Tutorial
![How to Use GridLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container) How to Use GridLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/GridLayoutDemo.png)
How to Use GridLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)
Setting the gaps between components and rows explicitly by calling the setHgap() : FlowLayout « Swing « Java Tutorial
![How to Use BorderLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container) How to Use BorderLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/BorderLayoutDemo.png)