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