![How to Use GridLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container) How to Use GridLayout (The Java™ Tutorials > Creating a GUI With 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 Swing > Laying Out Components Within a Container)
![How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container) How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/BoxLayoutDemo.png)
How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)
![How to remove extra white space from the components inside a container which has BoxLayout? - Stack Overflow How to remove extra white space from the components inside a container which has BoxLayout? - Stack Overflow](https://i.stack.imgur.com/z8w1U.png)
How to remove extra white space from the components inside a container which has BoxLayout? - Stack Overflow
![How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container) How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/AlignmentDemo-1.png)
How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With 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 BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container) How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/BoxLayoutDemo-wacky2.png)
How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)
![How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container) How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/BoxLayoutDemo-wacky.png)
How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)
![How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container) How to Use BoxLayout (The Java™ Tutorials > Creating a GUI With Swing > Laying Out Components Within a Container)](https://docs.oracle.com/javase/tutorial/figures/uiswing/layout/BoxLayoutDemo-left2.png)