Instead of using the concept of "cell", you can use the "absolute" positioning for your cells in migLayout and glue the cells together, referring to the coordinates of neighboring cells. You need to specify the names in your cells in order to refer to them in migLayout.
Then you can reconfigure the cells at any time by changing the name references in the coordinates of the cells, you just need to call setComponentConstraints (...) for the affected cells.
fi you for insertige Z cell, you
See the miglayout demo application. some code might look like this:
myPanel.add(createCell("X1"), "pos 0 0 100 100"); myPanel.add(createCell("X2"), "pos X1.x2 0 200 X1.y2");
etc.
When you insert cell "Z",
myPanel.add(createCell("Z"), "pos 0 X1.z2 200 100");
you only need to change the y link of Y1 from X1.y2 to Z.y2.
I have done it. similar to creating a kind of multi-splitpane, and it seems to work well.
source share