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