static int withLeftMargin_defaultWidth = 6; static JPanel withLeftMargin(Component c) { JPanel p = new JPanel(new BorderLayout); int w = withLeftMargin_defaultWidth; p.setBorder(BorderFactory.createEmptyBorder(0, w, 0, 0)); p.add(c); ret p; }