Microsoft SDK for Java

addChild

This method of the ElementImpl class contains the following signatures:

addChild(Element elem, Element after)
addChild(Element elem, int pos, int reserved)

addChild(Element elem, Element after)

Adds a child to this element. Any element can only have one parent element, so the previous parent will lose this child from its subtree.

Syntax

public void addChild(Element elem, Element after);

Parameters

elem The element to add. The child element becomes the last element if after is null. The child is added to the beginning of the list if after is this object.
after The element after which to add it.

addChild(Element elem, int pos, int reserved)

Adds a child to this element.

Syntax

public void addChild(Element elem, int pos, int reserved);

Parameters

elem The element to add.
pos The position to add this element (calling getChild(pos) will return this element). If pos is less than 0 (zero), elem becomes the new last element.
reserved The reserved parameter.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.