JPanel c1 = new JPanel();
c1.setMinimumSize(new Dimension(10, 10));
c1.setPreferredSize(new Dimension(20, 20));
c1.setMaximumSize(new Dimension(30, 30));
c.add(c1);
OverlayLayout l = new OverlayLayout(c);
h.check(l.maximumLayoutSize(c).width, 30);
h.check(l.maximumLayoutSize(c).height, 30);
}