System.arraycopy(children, 0, newChildren, 0, index); System.arraycopy(children, index, added, 0, added.length); int index2 = index + removed.length; int len2 = children.length - index2; System.arraycopy(children, index2, newChildren, index + added.length, len2); children = newChildren;
View[] newChildren = new View[added.length]; for (int i = 0; i < added.length; ++i) newChildren[i] = vf.create(added[i]); replace(index, removed.length, newChildren);
  protected boolean updateChildren(DocumentEvent.ElementChange ec,                                   DocumentEvent ev,                                   ViewFactory vf)  {    Element[] added = ec.getChildrenAdded();    Element[] removed = ec.getChildrenRemoved();    View[] newChildren = new View[children.length + added.length                                  - removed.length];    int index = ec.getIndex();    System.arraycopy(children, 0, newChildren, 0, index);    System.arraycopy(children, index, added, 0, added.length);    int index2 = index + removed.length;    int len2 = children.length - index2;    System.arraycopy(children, index2, newChildren, index + added.length,                     len2);    children = newChildren;    return true;  }