private void packLayout(int padding) {
      if (rows.size() < 1) {
        return;
      }

      // Prepare to stash maxima
      Spring[] maxWidths = new Spring[rows.get(0).componentCount()];
      Spring[] maxSpanWidths = new Spring[rows.get(1).componentCount() - 1];
      for (int i = 0; i < maxWidths.length; ++i) {
        maxWidths[i] = Spring.constant(0);
      }
      for (int i = 0; i < maxWidths.length - 1; ++i) {
        maxSpanWidths[i] = Spring.constant(0);
      }

      final Spring padSpring = Spring.constant(padding);
      Constraints parentConstraints = springLayout.getConstraints(this);

      // Compute maximum widths of columns and heights of rows
      for (FormattingRow row : rows) {
        row.computeMaxima(maxWidths, maxSpanWidths);
      }

      // Compute column coordinates
      Spring tWidth = maxWidths[0];
      final Spring dualPad = Spring.sum(padSpring, padSpring);
      Spring[] xs = new Spring[maxWidths.length];
      xs[0] = padSpring;

      for (int i = 1; i < xs.length; ++i) {
        // Set the current x coordinate to that maximum, plus the initial padding
        xs[i] = Spring.sum(dualPad, tWidth);
        // Compute the total width thus far as the sum of all column widths and the padding between
        tWidth = Spring.sum(padSpring, Spring.sum(tWidth, maxWidths[i]));
        // Use whichever is larger of the width of spanning columns and the current sum, for both
        tWidth = maxSpanWidths[i - 1] = Spring.max(tWidth, maxSpanWidths[i - 1]);
      }

      // Apply computed coordinate springs to each component
      Spring y = padSpring;
      for (FormattingRow row : rows) {
        y = row.applyMaxima(maxWidths, maxSpanWidths, padSpring, xs, y);
      }

      // Set our size to our sums
      parentConstraints.setConstraint(SpringLayout.SOUTH, y);
      parentConstraints.setConstraint(SpringLayout.EAST, Spring.sum(tWidth, dualPad));
    }