create Group Layout - Java Swing

Java examples for Swing:Layout Manager

Description

create Group Layout

Demo Code


//package com.java2s;

import javax.swing.GroupLayout;

import javax.swing.JPanel;

public class Main {
    public static final GroupLayout createGroupLayout(final JPanel panel) {
        final GroupLayout layout = new GroupLayout(panel);
        layout.setAutoCreateGaps(true);//  w  w  w .j av  a 2s. co  m
        layout.setAutoCreateContainerGaps(true);
        panel.setLayout(layout);
        return layout;
    }
}

Related Tutorials