Java Swing FlowLayout layoutFlow(JComponent... list)

Here you can find the source of layoutFlow(JComponent... list)

Description

Layout components using a flow layout

License

BSD License

Declaration

public static JComponent layoutFlow(JComponent... list) 

Method Source Code

//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;
    }
}

Related

  1. addToFlowLayout(JComponent comp, int flowLayoutAlignment)
  2. createPanel(LayoutManager layout, Component... components)
  3. flowLayoutPanel(Component... components)
  4. getFlowLayoutPanelLeftAligned(String title, Component component)
  5. wrapInPanel(final JComponent comp, final LayoutManager lm)