void () { myInterpreterPathLabel.setAnchor(null); if (myAnchoredLabel != null) { myAnchoredLabel.setAnchor(null); myAnchoredLabel = null; } if (!myVisibleLabelsColumn.isEmpty()) { JBLabel labelWithMaxWidth = Collections.max(myVisibleLabelsColumn, Comparator.comparingInt(o -> o.getPreferredSize().width)); if (myInterpreterPathLabel.getPreferredSize().width < labelWithMaxWidth.getPreferredSize().getWidth()) { myInterpreterPathLabel.setAnchor(labelWithMaxWidth); } else { for (JBLabel label : myVisibleLabelsColumn) { label.setAnchor(myInterpreterPathLabel); label.revalidate(); } myAnchoredLabel = labelWithMaxWidth; } } }