jgoodies FormLayout 布局错误提示:The row index 12 must be less than or equal to 10.
解决办法: jgoodies 的FormLayout用起来还比较简单,不过网上中文资料不太多,出错就是比较麻烦,所以记录下该问题
原因分析:字面意思为索引越界
代码解析:
String colLayout = "2dlu, max(32dlu;pref), 2dlu, pref:grow, 4dlu";
String rowLayout = "4dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref";
FormLayout layoutInfo = new FormLayout(colLayout, rowLayout);
JPanel panelInfo = new JPanel();
PanelBuilder builderInfo = new PanelBuilder(panelInfo, layoutInfo);
核心问题为:rowLayout 的含义,每逗号分隔这表示一行,根据该规则增加对应行即可以解决该问题