When you are using group layout you set all the gaps with:
setAutoCreateGaps(true); setAutoCreateContainerGaps(true);
Is there a same function for GridBagLayout?
GridBagLayout
Setting Gap Sizes in a GridBadLayout
good description
use EmptyBorders
use invisible JComponents
JComponents