Java tutorial
import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class EtchedBorderBorderFactory extends JFrame { public EtchedBorderBorderFactory() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); JLabel label; label = new JLabel("Etched"); label.setBorder(BorderFactory.createEtchedBorder()); panel.add(label); getContentPane().add(panel); pack(); } public static void main(String[] args) { EtchedBorderBorderFactory s = new EtchedBorderBorderFactory(); s.setVisible(true); } }