JComponent (JComponent component) { final JPanel wrapper = new JPanel(new BorderLayout()); wrapper.add(component, BorderLayout.WEST); wrapper.add(Box.createHorizontalGlue(), BorderLayout.CENTER); return wrapper; }