Java Swing BoxLayout createBoxLayoutPanel(boolean vertical)

Here you can find the source of createBoxLayoutPanel(boolean vertical)

Description

create Box Layout Panel

License

LGPL

Declaration

public static JPanel createBoxLayoutPanel(boolean vertical) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import javax.swing.*;

public class Main {
    public static JPanel createBoxLayoutPanel(boolean vertical) {
        JPanel panel = new JPanel();
        BoxLayout layout = new BoxLayout(panel, vertical ? BoxLayout.Y_AXIS
                : BoxLayout.X_AXIS);
        panel.setLayout(layout);//ww  w  .  j  a v  a  2  s. c  o  m

        return panel;
    }
}

Related

  1. createBox(Component center, Component north, Component south, Component west, Component east)
  2. createBox(int axis, Object... children)
  3. createBox(int orientation, JComponent... components)
  4. createBoxFiller()
  5. createBoxLayout(Container container, int axis, Component... components)
  6. createBoxPanel(int axis)
  7. createBoxPanel(int orientation)
  8. createHorizontalBox(int[] ratios, Component... comps)
  9. createHorizontalBoxLayout(Component... components)