Grid bag layout not displaying the way I want

后端 未结 4 1999
暗喜
暗喜 2021-01-06 18:00

So I have 6 panels, all of them used a grid layout. And I put them together using gridbaglayout, here is the design I wanted

4条回答
  •  醉话见心
    2021-01-06 18:43

    I am not familiar enough with the GridBagLayout to quickly spot what you can improve to your code to fix this. But another approach might be possible, using nested BorderLayouts.

    Panels 'first', 'third' and 'fourth' can be placed inside one JPanel Awith a BorderLayout in the NORTH, WEST and EAST respectively. The same can be done for the panels 'second', 'fifth' and 'sixth' in a JPanel B.

    Then you group those 2 panels (A and B) in another panel with a BorderLayout in the WEST and EAST

提交回复
热议问题