void (Container container) { Insets insets = container.getInsets(); int i = container.getSize().height - (insets.top + insets.bottom + vGap * 2); int j = container.getSize().width - (insets.left + insets.right + hGap * 2); int k = container.getComponentCount(); int l = insets.left + hGap; int i1 = 0; int j1 = 0; int k1 = 0; for(int l1 = 0; l1 < k; l1++){ Component component = container.getComponent(l1); if (!component.isVisible()) continue; Dimension dimension = component.getPreferredSize(); if (myVerticalFill && l1 == k - 1){ dimension.height = Math.max(i - i1, component.getPreferredSize().height); } if (myHorizontalFill){ component.setSize(j, dimension.height); dimension.width = j; } else{ component.setSize(dimension.width, dimension.height); } if (i1 + dimension.height > i){ a(container, l, insets.top + vGap, j1, i - i1, k1, l1); i1 = dimension.height; l += hGap + j1; j1 = dimension.width; k1 = l1; continue; } if (i1 > 0){ i1 += vGap; } i1 += dimension.height; j1 = Math.max(j1, dimension.width); } a(container, l, insets.top + vGap, j1, i - i1, k1, k); }