Java tutorial
//package com.java2s; import javax.swing.BoxLayout; import javax.swing.JPanel; public class Main { public static JPanel boxPanel(int axis) { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, axis)); return p; } }