if (containerListener != null) containerListener.componentAdded (ce);
  protected void addImpl (Component comp, Object constraints, int index)  {    if (index > ncomponents	|| comp instanceof Window	|| (comp instanceof Container	    && ((Container) comp).isAncestorOf (this)))      throw new IllegalArgumentException ();    // Reparent component, and make sure component is instantiated if    // we are.    if (comp.parent != this)      comp.parent.remove (comp);    comp.parent = this;    if (peer != null)      comp.addNotify ();    invalidate ();    // This isn't the most efficient implementation.  We could do less    // copying when growing the array.  It probably doesn't matter.    if (ncomponents >= component.length)      {	int nl = component.length * 2;	Component[] c = new Component[nl];	System.arraycopy (component, 0, c, 0, ncomponents);	component = c;      }    if (index == -1)      component[ncomponents++] = comp;    else      {	System.arraycopy (component, index, component, index + 1,			  ncomponents - index);	component[index] = comp;	++ncomponents;      }    // Notify the layout manager.    if (layoutMgr != null)      {	if (constraints != null && layoutMgr instanceof LayoutManager2)	  {	    LayoutManager2 lm2 = (LayoutManager2) layoutMgr;	    lm2.addLayoutComponent (comp, constraints);	  }	else	  layoutMgr.addLayoutComponent ((String) constraints, comp);      }    ContainerEvent ce = new ContainerEvent (this,					    ContainerEvent.COMPONENT_ADDED,					    comp);    // FIXME: is this right?    dispatchEvent (ce);    if (containerListener != null)      containerListener.componentAdded (ce);  }