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();
    }
}
