Have a look at javax.swing.border.TitledBorder
. You can set them on panels and are similar in appearance to HTML fieldsets.
Border titleBorder = new TitledBorder(new LineBorder(Color.RED), "Fieldset");
You could then add the border to your panel using the setBorder()
method.