public void layoutContainer(Container paramContainer) {
    Component[] arrayOfComponent = paramContainer.getComponents();

    this.counter = 0;
    for (int i = 0; i < arrayOfComponent.length; i++)
    {
      Component localComponent = paramContainer.getComponent(i);

      if (this.horizontal)
        localComponent.setLocation(this.counter, 0);
      else {
        localComponent.setLocation(0, this.counter);
      }
      localComponent.setSize(localComponent.getSize());

      if (this.horizontal)
      {
        this.counter += localComponent.getSize().width + this.ItemGap;
        this.max = Math.max(this.max, localComponent.getSize().height);
      }
      else
      {
        this.counter += localComponent.getSize().height + this.ItemGap;
        this.max = Math.max(this.max, localComponent.getSize().width);
      }
    }
  }