Grid bag layout not displaying the way I want

后端 未结 4 1963
暗喜
暗喜 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:42

    Add this:

    c.gridwidth = 2;

    Before adding the FIRST and SECOND panels, then set gridwidth back to 1 before adding the others. Alternatively you could separate them further as suggested above. You could use two FlowLayouts for each row, and add those two to another panel with a BorderLayout with NORTH/SOUTH.

提交回复
热议问题