Here you can find the source of layoutEvenHorizontal(JComponent... list)
public static JComponent layoutEvenHorizontal(JComponent... list)
//package com.java2s; /***/* w w w . j a v a2 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.GridLayout; import javax.swing.*; public class Main { /** * Layout components in evenly split horizontal boxes */ public static JComponent layoutEvenHorizontal(JComponent... list) { JPanel p = new JPanel(new GridLayout(1, list.length)); for (JComponent c : list) p.add(c); return p; } }