Component r = component[index];
synchronized (getTreeLock ()) { Component r = component[index];
  public void remove(int index)  {    Component r = component[index];    r.removeNotify();    System.arraycopy(component, index + 1, component, index,                      ncomponents - index - 1);    component[--ncomponents] = null;    invalidate();    if (layoutMgr != null)      layoutMgr.removeLayoutComponent(r);    // Post event to notify of adding the container.    ContainerEvent ce = new ContainerEvent(this,                                            ContainerEvent.COMPONENT_REMOVED,                                            r);    getToolkit().getSystemEventQueue().postEvent(ce);  }