title: Java swing gridbaglayout not filling one row entirely
body: <p>I have a panel that uses a GridbagLayout display to place 3 objects: A button, combobox, and a scrollPane. I want the button and the combobox to be on the same row (row 0) and occupy the entire row. This is how I have placed them in the panel:</p>
  
  <pre><code>GridBagConstraints gc = new GridBagConstraints();
  gc.fill = GridBagConstraints.BOTH;
  gc.insets.set(10, 0, 10, 10);
  add(comboBox, gc);
  gc.gridx = 1;
  gc.weightx = 1;
  gc.insets.set(10, 0, 10, 0);
  add(okButton, gc);
  </code></pre>
  
  <p>Now I want the scrollpane to  occupy the entire bottom row (row 1). This is what I did:</p>
  
  <pre><code>gc.gridx = 0;
  gc.gridy = 1;
  gc.weighty = 1;
  //gc.insets.set(0, 0, 0, 0);
  add(scrollPane, gc);
  </code></pre>
  
  <p>However this only makes the scrollpane occupy the first column of the bottom row, so it is always aligned with the combobox. How do I make it such that it occupies the entire bottom row and not just the first column? Willing to try a different layout if that will help. The idea I have is to create a new panel that just contains the scrollPane and add that to the current panel, but I would much rather not do that if there is an alternative</p>
  
  <p>Here is the current panel</p>
  
  <p><img src="https://i.stack.imgur.com/Y6FEU.png" alt="Image of the current panel"></p>