javaswinglayout-managermiglayout

How to get a Miglayout cell to span vertically down all rows


I have a Miglayout set up as such.

setLayout(new MigLayout("hidemode 3","[200]" +"[50]" +"[400]",
                                    "[]" +
                                    "[]" +
                                    "[]" +
                                    "[]" +
                                    "[]" +
                                    "[]" +
                                    "[]"));

In the rightmost (third) column I want it to span down all seven rows. As if it were one merged cell going the whole vertical length of the layout. Spanning horizontally seems to work fine, but I can't get or find a command to make it span vertically.

This is how I have that element in code:

add(myRightColumn, "cell 2 0");

but I've also tried adding ,span and ,spany and listing the series of cell/row numbers in the string argument. All with no luck.

What is the correct syntax for what I want to do? Thanks!


Solution

  • I have solved it. The correct way to do this is like so

    add(myRightColumn, "cell 2 0, span 1 7");
    

    meaning it should span 1 column and 7 rows.