public static JPanel createRowWithTopAndBottomPadding(final JPanel contentRow,final int topPadding,final int bottomPadding){
  final JPanel rowContents=new JPanel();
  rowContents.setLayout(new BoxLayout(rowContents,BoxLayout.Y_AXIS));
  rowContents.add(Box.createVerticalStrut(topPadding));
  rowContents.add(contentRow);
  rowContents.add(Box.createVerticalStrut(bottomPadding));
  return rowContents;
}

public static JPanel createRowWithTopAndBottomPadding ( final JPanel contentRow , final int topPadding , final int bottomPadding ) { final JPanel rowContents = new JPanel ( ) ; rowContents . setLayout ( new BoxLayout ( rowContents , BoxLayout . Y_AXIS ) ) ; rowContents . add ( Box . createVerticalStrut ( topPadding ) ) ; rowContents . add ( contentRow ) ; rowContents . add ( Box . createVerticalStrut ( bottomPadding ) ) ; return rowContents ; }
returns a row that has some padding at the top of it , and bottom .
