void () { Rectangle bounds = ui.getTabComponent().getBounds(); Dimension idSize = isIdVisible() ? idLabel.getPreferredSize() : JBUI.emptySize(); int eachX = 0; int eachY = 0; idLabel.setBounds(eachX, eachY, idSize.width, bounds.height); eachX += idSize.width; Dimension comboSize = comboLabel.getPreferredSize(); int spaceLeft = bounds.width - eachX - (isToDrawCombo() && isIdVisible() ? 3 : 0); int width = comboSize.width; if (width > spaceLeft) { width = spaceLeft; } comboLabel.setBounds(eachX, eachY, width, bounds.height); }