Pregunta

I want a 2-column layout where I can specify which column to insert the next element into. It needs to grow automatically -- I don't want to specify the row.

So, for example, I want to say:

  • add 4 elements in column 1
  • add 3 elements in column 2

And the resulting table would look like this:

[1][1]
[1][1]
[1][1]
[1]

What's the easiest way to do this with MigLayout?

¿Fue útil?

Solución

Make two different panels for each column, with one column in each panel.

It gets a bit painful sometimes to work with layered panels in MigLayout, but absent any specific problems, this is the easiest.

Otros consejos

Use GridLayout like:

   GridLayout layout=new GridLayout(4, 2);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top