1、Box类调用 createVerticalBox()可获得一个具有列型盒式的布局的盒式容器;
Box boxV1.createVerticalBox()
createHorizontalBox()可以获得一个具有行型盒式布局的盒式容器。
Box boxV2.createHorizontalBox()
Box调用createHorizontalStrut(int width)可得到Struct对象。其水平支撑高度为0;
createHorizontalStruct(int high)同理。
2、添加组件键的空隙(glue组件)
创建一个水平方向组件(不可见),用于撑满水平方向剩余的空间(多个该组件,平分剩余空间) Component Live_Glue = Box.createHorizontalGlue(); 创建一个垂直方向组件(不可见),用于撑满垂直方向剩余的空间(多个该组件,平分剩余空间) Component Vertical_Glue = Box.createVerticalGlue(); 创建一个水平和垂直方向组件(组件),用于撑满水平和垂直方向剩余的空间(多个该组件,则平分剩余空间) Component glue = Box.createGlue();