Java tutorial
//package com.java2s; import javax.swing.BorderFactory; import javax.swing.border.Border; public class Main { static final Border empty10Border = BorderFactory.createEmptyBorder(3, 2, 6, 2); static final Border etchedBorder = BorderFactory.createEtchedBorder(); public static Border getTitledBorder(String title) { return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(etchedBorder, title), empty10Border); } }