public class ConfigPanel extends JPanel{
public ConfigPanel(){
LC lc = new LC();
lc.fill();
AC ac = new AC();
ac.size("pref").fill().grow();
//初始化时需要设定好行列的属性, 否则会造成不准确, 后续单元格的属性设置依赖布局管理器的初始化值,且后面不能修改
this.setLayout(new MigLayout("fill", "[grow]","[][grow][][]"));
init();
}
private void init(){
add(new JLabel("显示如下:"),"wrap");
add(new JScrollPane(new JTextArea()), "grow,wrap");
add(new JButton("Close"),new CC().spanX().alignX("center"));// center或者50%表示在容器中居中
}
public static void main(String[] args) {
FrameUtil.display(new ConfigPanel());
}
}