void (Component c) { Dimension minimumSize = getMinimumSize(c); c.setMinimumSize(new Dimension(Math.max(minimumSize.width, c.getMinimumSize().width), Math.max(minimumSize.height, c.getMinimumSize().height))); }