protected void updatePathEllipsis() {
    if (getGraphics() == null) {
      return;
    }
    final FontMetrics fm = getGraphics().getFontMetrics();
    m_textEllipsis = super.getText();
    int maxlen = m_textEllipsis.length();

    String newValue = m_textEllipsis;
    final int width = getWidth();
    while ((maxlen >= 12) && (fm.stringWidth(newValue) > width)) {
      newValue = FileUtils.getPathEllipsis(m_textEllipsis, maxlen);
      maxlen--;
    }
    m_textEllipsis = newValue;
  }
Updates the shortened path string depending on the current width.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/CPathLabel.java