BoxLayout is a Java Swing layout manager that allows multiple components to be laid out either vertically or horizontally.
The GridBagLayout is a flexible Java Swing layout manager that aligns components vertically, horizontally or along their baseline without requiring that the components be of the same size
"Although madprogrammers comment to use a gridbaglayout is an easier solution but knowing about glue and struts can be helpful for customizing the layout of a boxlayout"
from question "How to Center JButtons in a centered JLabel in a BoxLayout?"
"Boxlayout is far easier than gridbaglayout because you don t have to learn how to specify constraints"
from question "A java sidebar with GridBagLayout"