I am trying to create a panel that can dynamically insert components based on events. The panel is row based with variable amount of components per row. However, I have problems inserting components between existing ones.
For example, if I have following layout (lines represent MigLayout cells) :
+----+----+----+
| X1 | X2 | X3 |
+----+----+----+----+
| Y1 | Y2 | Y3 | Y4 |
+----+----+----+----+
Is it possible to create a cell between rows X and Y, to get:
+----+----+----+
| X1 | X2 | X3 |
+----+----+----+
| Z1 |
+----+----+----+----+
| Y1 | Y2 | Y3 | Y4 |
+----+----+----+----+
I tried content.add(component, "cell 1 0, wrap");
but it inserts the component into the Y1
cell.
The only solution I have so far is to call content.add(component, "wrap", index);
. However, this requires that I know a total count of preceding components.