title: Changing the Grid Size in a GridBagLayout
body: <p>I am just trying to add 3 centered vertical buttons to a GridBagLayout in java swing.  Right now I believe the default grid size is 3x3.  I wanted to know if I can change that and add more columns and rows.  I simply want to make 3 centered equally spaced butons in a pane.</p>
  
  <pre><code>    pane.setLayout(new GridLayout(10,1));
      // Insert a space before the first button
      for (int i = 1; i &lt; 6; i++ ){
          pane.add(new JLabel(""));
      }
      pane.add(new Button("1"));
      pane.add(new Button("2"));
          pane.add(new Button("3"));
      // Insert a space after the last button
      pane.add(new JLabel(""));
  </code></pre>
  
  <p>That was the final solution Thanks everyone!</p>