title: GridBagConstraints gridheight and gridwidth
body: <p>Using <code>GridBagLayout</code>, I'm trying to arrange my components like this:</p>
  
  <p><img src="https://i.stack.imgur.com/7iH40.png" alt="Attempted layout with grid painted"></p>
  
  <p>But the components turn out like this, all mushed together and stuff:</p>
  
  <p><img src="https://i.stack.imgur.com/texa1.png" alt="Actual layout"></p>
  
  <p>I've never used the <code>GridBagConstraints</code> fields <code>gridwidth</code> and <code>gridheight</code> before. What am I doing incorrectly? Here's an SSCCE:</p>
  
  <pre><code>import java.awt.Dimension;
  import java.awt.GridBagConstraints;
  import java.awt.GridBagLayout;
  import javax.swing.*;
  
  public class GUI extends JFrame {
  
      private GridBagLayout gridBag = new GridBagLayout();
      GridBagConstraints constraints = new GridBagConstraints();
      private static final String[] ALL_STRINGS = { "B", "A", "C" };
  
      private JButton leftButton = new JButton("&lt;");
      private JButton rightButton = new JButton("&gt;");
      private JList&lt;String&gt; list = new JList&lt;String&gt;(ALL_STRINGS);
      private JList&lt;String&gt; queue = new JList&lt;String&gt;();
      private JPanel selectionPanel = new JPanel(gridBag);
      private JCheckBox filterBox = new JCheckBox("filterBox");
      private JButton clear = new JButton("Clear");
  
      public GUI() {
          setWindowProperties();
          addComponents();
      }
  
      private void setWindowProperties() {
          setLayout(gridBag);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setSize(new Dimension(400, 400));
          setTitle("GridBagLayout issues");
          setResizable(false);
          setLocationRelativeTo(null);
      }
  
      private void setUpSelectionPanel() {
          JLabel listLabel = new JLabel("Quest List");
          JLabel queueLabel = new JLabel("Queue");
          JScrollPane listScroll = new JScrollPane(list);
          JScrollPane queueScroll = new JScrollPane(queue);
          Dimension scrollSize = new Dimension(150, 300);
          listScroll.setPreferredSize(scrollSize);
          queueScroll.setPreferredSize(scrollSize);
  
          constraints.gridx = 0;
          constraints.gridy = 0;
          gridBag.setConstraints(listLabel, constraints);
  
          constraints.gridx = 0;
          constraints.gridy = 1;
          constraints.gridwidth = 2;
          constraints.gridheight = 3;
          gridBag.setConstraints(listScroll, constraints);
  
          constraints.gridx = 2;
          constraints.gridy = 1;
          gridBag.setConstraints(filterBox, constraints);
  
          constraints.gridx = 2;
          constraints.gridy = 2;
          gridBag.setConstraints(leftButton, constraints);
  
          constraints.gridx = 2;
          constraints.gridy = 3;
          gridBag.setConstraints(rightButton, constraints);
  
          constraints.gridx = 2;
          constraints.gridy = 4;
          gridBag.setConstraints(clear, constraints);
  
          constraints.gridx = 3;
          constraints.gridy = 0;
          gridBag.setConstraints(queueLabel, constraints);
  
          constraints.gridx = 3;
          constraints.gridy = 1;
          constraints.gridwidth = 2;
          constraints.gridheight = 3;
          gridBag.setConstraints(queueScroll, constraints);
  
          selectionPanel.add(listLabel);
          selectionPanel.add(listScroll);
          selectionPanel.add(filterBox);
          selectionPanel.add(leftButton);
          selectionPanel.add(rightButton);
          selectionPanel.add(clear);
          selectionPanel.add(queueLabel);
          selectionPanel.add(queueScroll);
      }
  
      private void addComponents() {
          setUpSelectionPanel();
          add(selectionPanel);
      }
  
      public static void main(String[] args) {
          new GUI().setVisible(true);
      }
  }
  </code></pre>