简体   繁体   中英

Java - Which Layout Manager should I use for my program?

程序

Originally I wanted to use Border Layout but you can only use up to 9 boxes from my understanding. Is this true or not?

Also is there something more easier than GridBagLayout yet more flexible than Grid Layout?

You can combine 2 border and 1 grid layout.

The outer border layout will contain titlle on north, and other panel with border layout in the center.

The second panel will contain subtitle at north and grid layout with 2 lines only in the center.

The grid layout can contain other grid layout 3*3 for buttons on the upper line and border layout with with large box at the center.

Alternative solution is using GridBagLayout . However you should do some exercises with it to get it working.

Other solution is using MigLayout - the third party open source solution that allows creating any view very simply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM