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