GridBagLayout fix space set by weight x/y
问题 I have a frame with the following layout of 3 JPanels. ---------------------------- | | | | l | | | e | //toppanel | | f | | | t |----------------------| | p | | | n | //bottompanel | | l | | | | | ---------------------------- I achieved this with the use of GridBagLayout This is the code for that layout public class UITests extends JFrame{ public UITests(){ setLayout(new GridBagLayout()); //the three main panels JPanel leftPanel = new JPanel(); JPanel topPanel = new JPanel(); JPanel