code: private void callDoLayout(Container container)
      {
          container.doLayout();
          int n = container.getComponentCount();
          for (int i=0; i<n; i++)
          {
              Component component = container.getComponent(i);
              if (component instanceof Container)
              {
                  Container subContainer = (Container)component;
                  callDoLayout(subContainer);
              }
          }
      }
docs: Recursively call doLayout on the container and all its
  sub-containers
  
  @param container The container