// setting a border on a JPanel

import javax,swing.BorderFactory;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.JPanel;

//...

// some possible Border types:
Border b1 = BorderFactory.createLineBorder( Color.black );
Border b2 = BorderFactory.createEtchedBorder( EtchedBorder.LOWERED );
Border b3 = new BevelBorder ( BevelBorder.LOWERED, Color.red );

JPanel panel = new JPanel();
panel.setBorder( b2 );