void () { final Component[] components = getComponents(); final Rectangle r = getBounds(); for (Component c : components) { if (c instanceof JScrollPane) { c.setBounds(0, 0, r.width, r.height); } else { final Dimension d = c.getPreferredSize(); final MyScrollBar scrollBar = getVerticalScrollBar(); c.setBounds(r.width - d.width - scrollBar.getWidth() - 30, 20, d.width, d.height); } } }