void () { super.doLayout(); JComponent firstComponent = getFirstComponent(); JComponent secondComponent = getSecondComponent(); if (firstComponent == null || secondComponent == null) { return; } int firstHeight = firstComponent.getHeight(); int dividerHeight = getDivider().getHeight(); int height = getSize().height; if (firstHeight + dividerHeight + secondComponent.getHeight() != height) { Rectangle bounds = secondComponent.getBounds(); bounds.height = height - firstHeight - dividerHeight; secondComponent.setBounds(bounds); } }