add To Flow Layout - Java Swing

Java examples for Swing:Layout Manager

Description

add To Flow Layout

Demo Code


//package com.java2s;

import java.awt.FlowLayout;

import javax.swing.JComponent;
import javax.swing.JPanel;

public class Main {
    public static JPanel addToFlowLayout(JComponent comp,
            int flowLayoutAlignment) {
        JPanel panel = new JPanel(new FlowLayout(flowLayoutAlignment));
        panel.add(comp);//from  w  w w .j a  v a2  s.com
        return panel;
    }
}

Related Tutorials