/** * Sets the component's parent. * * @param parent The new parent. * @exception ComponentException Thrown if the new parent is not a valid parent for this * component. */ public void setParent(BaseComponent parent) { if (parent != this.parent) { if (parent == null) { this.parent.removeChild(this); } else { parent.addChild(this); } } }