Use gridbaglayout because it gives you the ability to assign weights, columns, or rows and specify distance and fill values.
I created a Swing application that contains 12 frames, and they are all made using GridBagLayout.
I also tried others before, but they all had limitations. What is where GridBagLayout kicks. It's a little harder to start understanding how this works, but once you feel it, it's really best to get the components where you want.
If you want, I will give you a cool example of a frame created using GridBagLayout.
source share