return rootView.getNextVisualPositionFrom(pos, b, getVisibleEditorRect(),
int offset = -1; Document doc = textComponent.getDocument(); if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readLock(); try { Rectangle alloc = getVisibleEditorRect(); if (alloc != null) { rootView.setSize(alloc.width, alloc.height); offset = rootView.getNextVisualPositionFrom(pos, b, alloc,
  public int getNextVisualPositionFrom(JTextComponent t, int pos,                                       Position.Bias b, int direction,                                       Position.Bias[] biasRet)    throws BadLocationException  {    // A comment in the spec of NavigationFilter.getNextVisualPositionFrom()    // suggests that this method should be implemented by forwarding the call    // the root view.    return rootView.getNextVisualPositionFrom(pos, b,                                              getVisibleEditorRect(),                                              direction, biasRet);  }