Java GUI Layouts

前端 未结 5 1979
耶瑟儿~
耶瑟儿~ 2021-01-07 02:55

Could somebody tell me which java layout I need to use to achieve the layout below:

\"Correct

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-07 03:12

    As stated in the previous comment, I would use MigLayout in this project. As you can use split, span and wrap after each field or textbox in order to get the correct layout. You can also debug Miglayout and see where your layout its right or wrong.

    download the latest version of MigLayout here : http://www.migcalendar.com/miglayout/versions/

    if using eclipse,

    • save it in a folder called Lib in the project folder.
    • configure the project build path but adding the jar file to the classpath.
    • Then you should be able to set the layout to MigLayout.

    panel.setLayout(new MigLayout());

    or to debug the layout - panel.setLayout(new MigLayout("debug"));

提交回复
热议问题