Why does this GridBagLayout not appear as planned?

I am afraid the desired layout is not so simple with simple GridBagLayout restriction. GBL does not respect proportions with gridwidth. It means it can’t detect 2/3 of component’s width.
So if you define

c1 (gridwidth=2) c2 (gridwidth=1)
c3 (gridwidth=3)

Expecting to get


The result will be


The camickr’s example works because the simple cell heights were defined and IMHO that’s the only way.

Leave a Comment