void (Splitter splitter) { JPanel jPanel1 = new JPanel(); jPanel1.setMinimumSize(new Dimension(100, 100)); jPanel1.setPreferredSize(new Dimension(100, 100)); JPanel jPanel2 = new JPanel(); jPanel2.setMinimumSize(new Dimension(100, 100)); jPanel2.setPreferredSize(new Dimension(100, 100)); splitter.setFirstComponent(jPanel1); splitter.setSecondComponent(jPanel2); splitter.setHonorComponentsMinimumSize(true); splitter.setSize(new Dimension(500, 500)); splitter.doLayout(); checkBounds(splitter); splitter.setSize(new Dimension(300, 300)); splitter.doLayout(); checkBounds(splitter); for (float proportion = 0; proportion <= 1; proportion+=0.01) { splitter.setProportion(proportion); splitter.doLayout(); checkBounds(splitter); } splitter.setProportion(.9f); splitter.doLayout(); checkBounds(splitter); splitter.setSize(new Dimension(100, 100)); splitter.doLayout(); checkBounds(splitter); splitter.setProportion(.1f); splitter.doLayout(); checkBounds(splitter); splitter.setSize(new Dimension(10, 10)); splitter.doLayout(); checkBounds(splitter); splitter.setSize(new Dimension(100, 100)); splitter.doLayout(); checkBounds(splitter); splitter.setSize(new Dimension(150, 150)); splitter.doLayout(); checkBounds(splitter); splitter.setSize(splitter.isVertical() ? new Dimension(150, 1000) : new Dimension(1000, 150)); for (float f = .01F; f < 1F; f+=.01F) { splitter.setProportion(f); splitter.doLayout(); float proportion = splitter.getProportion(); assertEquals(f, proportion); } }