Here you can find the source of setSize(Dimension size, JComponent[] components)
public static void setSize(Dimension size, JComponent[] components)
//package com.java2s; import java.awt.Dimension; import java.util.List; import javax.swing.JComponent; public class Main { public static void setSize(Dimension size, JComponent[] components) { for (JComponent component : components) { component.setSize(size);//from ww w .ja v a2 s . co m } } public static void setSize(Dimension size, List<JComponent> components) { for (JComponent component : components) { component.setSize(size); } } }