Here you can find the source of newJPanel(Component... c)
public static JPanel newJPanel(Component... c)
//package com.java2s; //License from project: Apache License import java.awt.Component; import java.awt.FlowLayout; import javax.swing.JPanel; public class Main { public static JPanel newJPanel(Component... c) { JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT)); for (int i = 0; i < c.length; i++) p.add(c[i]);//from w w w. ja v a2 s .c o m return p; } }