import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.border.EtchedBorder; public class Main { public static void main(String[] argv) { EtchedBorder etchedBorder = (EtchedBorder)BorderFactory.createEtchedBorder(); JLabel component = new JLabel("label"); component.setBorder(etchedBorder); } }