lineBreaker.setText(txt); int goodBreakLocation = lineBreaker.previous(); if (goodBreakLocation != BreakIterator.DONE) breakLocation = goodBreakLocation;
int breakLocation = Utilities.getBreakLocation(txt, getContainer().getFontMetrics(getFont()), (int) pos, (int) (pos + len), getTabExpander(), p0);
  public View breakView(int axis, int p0, float pos, float len)  {    if (axis == Y_AXIS)      return this;    checkPainter();    GlyphPainter painter = getGlyphPainter();    int breakLocation = painter.getBoundedPosition(this, p0, pos, len);    // Try to find a suitable line break.    BreakIterator lineBreaker = BreakIterator.getLineInstance();    Segment txt = new Segment();    try      {        getDocument().getText(getStartOffset(), getEndOffset(), txt);      }    catch (BadLocationException ex)      {        AssertionError err = new AssertionError("BadLocationException must not "                                                + "be thrown here.");        err.initCause(ex);        throw err;      }    lineBreaker.setText(txt);    int goodBreakLocation = lineBreaker.previous();    if (goodBreakLocation != BreakIterator.DONE)      breakLocation = goodBreakLocation;    View brokenView = createFragment(p0, breakLocation);    return brokenView;  }