int () { Insets insets = getInsets(); int width = getWidth() - insets.left - insets.right - myIconComponent.getPreferredSize().width - myHGap.get(); if (myProgressComponent != null) { return width - myProgressComponent.getPreferredSize().width - myHOffset.get(); } if (myCheckBoxComponent != null) { width -= myCheckBoxComponent.getPreferredSize().width + myHOffset.get(); } if (myTagComponent != null) { width -= myTagComponent.getPreferredSize().width + 2 * myHOffset.get(); } int visibleCount = 0; for (Component component : myButtonComponents) { if (component.isVisible()) { width -= component.getPreferredSize().width; visibleCount++; } } width -= myButtonOffset.get() * (visibleCount - 1); if (visibleCount > 0) { width -= myHOffset.get(); } return width; }