Here you can find the source of createVerticalBoxJPanel(JComponent parent)
public static JPanel createVerticalBoxJPanel(JComponent parent)
//package com.java2s; //License from project: Open Source License import javax.swing.*; public class Main { /**//from ww w .j a va 2 s .co m * @return A vertical {@link BoxLayout}ed JPanel. */ public static JPanel createVerticalBoxJPanel(JComponent parent) { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); parent.add(panel); return panel; } }