String (@Nls String fullText) { int labelWidth = getLabel().getWidth(); if (fullText == null || fullText.length() == 0) return " "; while (getLabel().getFontMetrics(getLabel().getFont()).stringWidth(fullText) > labelWidth) { int sep = fullText.indexOf(File.separatorChar, 4); if (sep < 0) return fullText; fullText = "..." + fullText.substring(sep); } return fullText; }