Examples of Swing borders

You can combine these borders with CompoundBorder.

Main.java:

import javax.swing.border.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
 
public class Main extends JFrame
{
   public Main() {
      getContentPane().setLayout(new FlowLayout(FlowLayout.LEFT));
 
      JLabel labels[] = new JLabel[6];
      labels[0] = new JLabel("Label with EmptyBorder, margin 20");
      labels[0].setBorder(new EmptyBorder(20, 20, 20, 20));
      labels[1] = new JLabel("Label with LineBorder, red color, thickness 3");
      labels[1].setBorder(new LineBorder(Color.red, 3));
      labels[2] = new JLabel("Label with LOWERED BevelBorder");
      labels[2].setBorder(new BevelBorder(BevelBorder.LOWERED));
      labels[3] = new JLabel("Label with RAISED EtchedBorder");
      labels[3].setBorder(new EtchedBorder(EtchedBorder.RAISED));
      labels[4] = new JLabel("Label with MatteBorder and Icon");
      labels[4].setBorder(new MatteBorder(new ImageIcon("c:\female.gif")));
      labels[5] = new JLabel("Label with BevelBorder TitledBorder");
      labels[5].setBorder(new TitledBorder(new BevelBorder(BevelBorder.LOWERED), "Title"));
 
      for (int i=0; i<labels.length; i++) {
         labels[i].setOpaque(true);
         getContentPane().add(labels[i]);
      }
      
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent we) {
            System.exit(0);
         }
      });
   }
 
   public static void main(String [] args) {
      Main main = new Main();
      main.setSize(300, 400);
      main.setVisible(true);
   } 
}