Java GUI Layouts

前端 未结 5 1957
耶瑟儿~
耶瑟儿~ 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:30

    Been a while since I worked with Swing, but it looks like the architecture is something like this:

    enter image description here

    1. You have a panel in the bottom which is BorderLayout
    2. Inside that, you add a total of 4 new panels, NORTH, WEST, CENTER and EAST
    3. in BorderLayout.NORTH you add a panel which have FlowLayout.LEFT
    4. in BorderLayout.WEST you add a panel which have GroupLayout.YAXIS. this panel contains the labels for names etc and the ENTER button
    5. in BorderLayout.CENTER you add the textfields that corresponds with the labels
    6. in BorderLayout.EAST you add the JSCrollpane.

    This might give you an idea and you can play around with these different panels to achive what you want

提交回复
热议问题