GridbagLayout seems to be ignoring component sizes
问题 I am using GridBagLayout for the first time. I have a JFrame which has 2 panel's inside. The frame is of width 1200 and height 800. The left most JPanel has the width of 800 and height of 800. The right most panel has the width of 400 and height of 800. When they are rendering using GridBagLayout they are both being shown with equal size. This is the code: public class DisplayFrame extends JFrame { public DisplayFrame() { //simple inheritance. super(title); setSize(new Dimension(1200, 800));