code: public static void equalizeSizes(JComponent[] components) {
          Dimension targetSize = new Dimension(0, 0);
          for (int i = 0; i < components.length; i++) {
              JComponent comp = components[i];
              Dimension compSize = comp.getPreferredSize();
              double width = Math.max(targetSize.getWidth(), compSize.getWidth());
              double height = Math.max(targetSize.getHeight(), compSize.getHeight());
              targetSize.setSize(width, height);
          }
          setSizes(components, targetSize);
      }
docs: Sets the items in <code>aComponents</code> to the same size.
  
  Sets each component's preferred and maximum sizes. The actual size is
  determined by the layout manager, which adjusts for locale-specific
  strings and customized fonts. (See this <a
  href="http://java.sun.com/products/jlf/ed2/samcode/prefere.html">Sun doc
  </a> for more information.)
  
  @param components
  contains <code>JComponent</code> objects.