static int withTopAndBottomMargin_defaultWidth = 6; static JPanel withTopAndBottomMargin(Component c) { ret withTopAndBottomMargin(withTopAndBottomMargin_defaultWidth, withTopAndBottomMargin_defaultWidth, c); } static JPanel withTopAndBottomMargin(int topMargin, int bottomMargin, Component c) { ret swing(-> { JPanel p = new JPanel(new BorderLayout); int w = withTopAndBottomMargin_defaultWidth; p.setBorder(BorderFactory.createEmptyBorder(topMargin, 0, bottomMargin, 0)); p.add(c); ret p; }); }