I think the best practice would be creating another JPanel
, but if I correctly understood your problem, maybe an alternative can be create a JSeparator
:
JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);
separator.setPreferredSize(new Dimension(200,3));