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)
How to Use BorderLayout (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container)
![How to Use GridBagLayout (The Java™ Tutorials > Creating a GUI With JFC/ Swing > Laying Out Components Within a Container) How to Use GridBagLayout (The Java™ Tutorials > Creating a GUI With JFC/ Swing > Laying Out Components Within a Container)](http://152.92.236.11/tutorial_java/figures/uiswing/layout/GridBagLayoutDemo.png)
How to Use GridBagLayout (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) 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)