for (int i = 0; i < ncomponents; ++i)
Component r = component[index];  ComponentListener[] list = r.getComponentListeners(); for (int j = 0; j < list.length; j++) r.removeComponentListener(list[j]);  r.removeNotify();  System.arraycopy(component, index + 1, component, index, ncomponents - index - 1); component[--ncomponents] = null;  invalidate();  if (layoutMgr != null) layoutMgr.removeLayoutComponent(r);  r.parent = null;  if (isShowing ())
  public void remove(Component comp)  {    synchronized (getTreeLock ())      {        for (int i = 0; i < ncomponents; ++i)          {            if (component[i] == comp)              {                remove(i);                break;              }          }      }  }