Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which layout manager to use for a nested table layout

I am looking for some guidance on how to achieve a certain Swing layout.

What I am looking to achieve is at the beginning have a layout with two rows. On a user command I would like the second row to split into several columns, and for each of these column cells to recursively split as above.

E.g. at the beginning:

 -------------------
| Some stuff here   |
 -------------------
|                   |
 -------------------

Becomes:

 -------------------
| Some stuff here   |
 -------------------
|  stuff  | stuff   |
|---------|---------|
|         |         |
 -------------------

etc.

like image 1000
user973758 Avatar asked Apr 20 '26 21:04

user973758


1 Answers

I would have said GridBagLayout, as it gives you exactly what you want without having to combine different layout managers within panels etc

Also refer to Java Visual Guide to LayoutManagers

like image 121
Dace Avatar answered Apr 23 '26 11:04

Dace



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!