void (final Component comp, final Object constraints) { if (!(constraints instanceof GridConstraints)) { throw new IllegalArgumentException("constraints: " + constraints); } final Component[] newComponents = new Component[myComponents.length + 1]; System.arraycopy(myComponents, 0, newComponents, 0, myComponents.length); newComponents[myComponents.length] = comp; myComponents = newComponents; final GridConstraints[] newConstraints = new GridConstraints[myConstraints.length + 1]; System.arraycopy(myConstraints, 0, newConstraints, 0, myConstraints.length); newConstraints[myConstraints.length] = (GridConstraints)((GridConstraints)constraints).clone(); myConstraints = newConstraints; }