Java examples for Swing:BoxLayout
create Horizontal Box
//package com.java2s; import javax.swing.*; import java.awt.*; public class Main { public static Box createHorizBox(Component... comps) { return createBox(BoxLayout.LINE_AXIS, comps); }/* w w w. j a v a 2 s . co m*/ public static Box createBox(int axis, Component... comps) { Box r = new Box(axis); for (Component comp : comps) { r.add(comp); } return r; } }