import javax.swing.*;
class Win extends JFrame {
    Box baseBox, boxH, boxV;
    public Win()
    {
    setTitle("BoxLayoutӦ");
        baseBox = Box.createHorizontalBox();
        boxH = Box.createHorizontalBox();
        boxV = Box.createVerticalBox();
       for (int i = 1; i <= 3; i++)
        {
     boxH.add(new JLabel("ǩ " + i));
        }
        for (int i = 1; i <= 5; i++)
        {
    boxV.add(new JButton("ť " + i));
        }
        baseBox.add(boxH);
        baseBox.add(boxV);
        add(baseBox);
        setBounds(200, 200, 200, 200);
        validate();
        setVisible(true);
    }
}
class BoxLayout_test
{
public static void main(String args[])
    {
        
        Win ta = new Win();
    }
}
