Java Utililty Methods Swing FlowLayout

List of utility methods to do Swing FlowLayout

Description

The list of methods to do Swing FlowLayout are organized into topic(s).

Method

JPaneladdToFlowLayout(JComponent comp, int flowLayoutAlignment)
add To Flow Layout
JPanel panel = new JPanel(new FlowLayout(flowLayoutAlignment));
panel.add(comp);
return panel;
JPanelcreatePanel(LayoutManager layout, Component... components)
create Panel
JPanel panel = new JPanel(layout);
for (Component comp : components) {
    panel.add(comp);
return panel;
JPanelflowLayoutPanel(Component... components)
flow Layout Panel
return newJPanel(new FlowLayout(), components);
JPanelgetFlowLayoutPanelLeftAligned(String title, Component component)
get Flow Layout Panel Left Aligned
JPanel jp = new JPanel();
jp.setLayout(new FlowLayout(FlowLayout.LEFT));
if (title != null) {
    if (component instanceof JPanel) {
        JPanel p = (JPanel) component;
        p.setBorder(BorderFactory.createTitledBorder(title));
jp.add(component);
return jp;
JComponentlayoutFlow(JComponent... list)
Layout components using a flow layout
JPanel p = new JPanel(new FlowLayout());
for (JComponent c : list)
    p.add(c);
return p;
JPanelwrapInPanel(final JComponent comp, final LayoutManager lm)
Wraps a component in a JPanel with the specified layout manager, and returns it.
final JPanel p = new JPanel(lm);
p.add(comp);
return p;