Creates a JPanel with a vertically-oriented BoxLayout. - Java Swing

Java examples for Swing:Layout Manager

Description

Creates a JPanel with a vertically-oriented BoxLayout.

Demo Code


//package com.java2s;
import javax.swing.*;

public class Main {
    /** Creates a JPanel with a vertically-oriented BoxLayout. */
    public static JPanel makeVerticalFlowPanel() {
        JPanel result = new JPanel();
        result.setLayout(new BoxLayout(result, BoxLayout.Y_AXIS));
        return result;
    }/* www .j  a  v a  2  s.  c  o  m*/
}

Related Tutorials