Here you can find the source of layoutFlow(JComponent... list)
public static JComponent layoutFlow(JComponent... list)
//package com.java2s; /***//from w ww. j a v a 2 s .c o m * Copyright (C) 2010 Johan Henriksson * This code is under the Endrov / BSD license. See www.endrov.net * for the full text and how to cite. */ import java.awt.FlowLayout; import javax.swing.*; public class Main { /** * Layout components using a flow layout */ public static JComponent layoutFlow(JComponent... list) { JPanel p = new JPanel(new FlowLayout()); for (JComponent c : list) p.add(c); return p; } }