void () { if (mySkipNextLayout) { mySkipNextLayout = false; return; } int width = getWidth(); int height = getHeight(); int total = isVertical() ? height : width; if (total <= 0) return; if (!isNull(myFirstComponent) && myFirstComponent.isVisible() && !isNull(mySecondComponent) && mySecondComponent.isVisible()) { // both first and second components are visible Rectangle firstRect = new Rectangle(); Rectangle dividerRect = new Rectangle(); Rectangle secondRect = new Rectangle(); int d = getDividerWidth(); double size1; if (total <= d) { size1 = 0; d = total; } else { size1 = computeFirstComponentSize(total - d); } int iSize1 = Math.max(0, (int)Math.round(size1)); int iSize2 = Math.max(0, total - iSize1 - d); if (isVertical()) { firstRect.setBounds(0, 0, width, iSize1); dividerRect.setBounds(0, iSize1, width, d); secondRect.setBounds(0, iSize1 + d, width, iSize2); } else { firstRect.setBounds(0, 0, iSize1, height); dividerRect.setBounds(iSize1, 0, d, height); secondRect.setBounds((iSize1 + d), 0, iSize2, height); } myDivider.setVisible(true); myFirstComponent.setBounds(firstRect); myDivider.setBounds(dividerRect); mySecondComponent.setBounds(secondRect); //myFirstComponent.revalidate(); //mySecondComponent.revalidate(); } else if (!isNull(myFirstComponent) && myFirstComponent.isVisible()) { // only first component is visible hideNull(mySecondComponent); myDivider.setVisible(false); myFirstComponent.setBounds(0, 0, width, height); //myFirstComponent.revalidate(); } else if (!isNull(mySecondComponent) && mySecondComponent.isVisible()) { // only second component is visible hideNull(myFirstComponent); myDivider.setVisible(false); mySecondComponent.setBounds(0, 0, width, height); //mySecondComponent.revalidate(); } else { // both components are null or invisible myDivider.setVisible(false); if (myFirstComponent != null) { myFirstComponent.setBounds(0, 0, 0, 0); //myFirstComponent.revalidate(); } else { hideNull(myFirstComponent); } if (mySecondComponent != null) { mySecondComponent.setBounds(0, 0, 0, 0); //mySecondComponent.revalidate(); } else { hideNull(mySecondComponent); } } //myDivider.revalidate(); }