is therefore imporant that valid is not set to true before after the children has been layed out. */
is therefore important that valid is not set to true until after the children have been layed out. */
  protected void validateTree()  {    if (valid)      return;    ContainerPeer cPeer = null;    if (peer != null && ! (peer instanceof LightweightPeer))      {        cPeer = (ContainerPeer) peer;        cPeer.beginValidate();      }    doLayout();    for (int i = 0; i < ncomponents; ++i)      {        Component comp = component[i];        if (! comp.isValid())          {            if (comp instanceof Container)              {                ((Container) comp).validateTree();              }            else              {                component[i].validate();              }          }      }    /* children will call invalidate() when they are layed out. It       is therefore imporant that valid is not set to true       before after the children has been layed out. */    valid = true;    if (cPeer != null)      cPeer.endValidate();  }