Here you can find the source of createGridedJPanel(JComponent parent, int columns)
public static JPanel createGridedJPanel(JComponent parent, int columns)
//package com.java2s; //License from project: Open Source License import java.awt.*; import javax.swing.*; public class Main { /**/*from w w w .j a v a2s . com*/ * @return A {@link GridLayout}ed JPanel with the given number of * columns. */ public static JPanel createGridedJPanel(JComponent parent, int columns) { JPanel panel = new JPanel(new GridLayout(0, columns)); parent.add(panel); return panel; } }