title: How to fill empty space in a JToolbar
body: <p>I have a <strong>JToolbar</strong> in one of my panels.</p>
  
  <p><strong>Abridged Code:</strong></p>
  
  <pre><code>//for the containing panel
  panel.setLayout(new BorderLayout());
  
  
  //adding the toolbar
  panel.add(toolbar, BorderLayout.WEST);
  </code></pre>
  
  <p>The toolbar has two <code>JButton</code>s that I add using <code>GridBagLayout</code> to make them of equal width</p>
  
  <p>//code for the toolbar</p>
  
  <pre><code>toolbar=new JToolbar();
  toolbar.setLayout(new GridBagLayout());
  btn1 = new JBUtton("update layout");
  btn2 = new JButton("exit!");
  GridBagContraints gbc = new GridBagConstraints();
  gbc.gridx=0;
  gbc.gridy=1;
  gbc.fill = GridBagConstrainsts.HORIZONTAL;
  toolbar.add(btn1,gbc);
  gbc.gridy=1;
  toolbar.add(btn1,gbc);
  </code></pre>
  
  <p>This code renders a vertical toolbar with button that take equal width. The only problem is that the height of the toolbar is more than the height of the buttons and hence this code renders the buttons in the vertical center of the toolbar. Instead I would want that the buttons are aligned to the top such that all the empty space is added to the end of the toolbar.</p>
  
  <p>Now:</p>
  
  <pre><code> ----------
   |        |
   ----------
   |  btn   |
   ----------
   |  btn2  |
   ----------
   |        |
   ----------
  </code></pre>
  
  <p>What I want</p>
  
  <pre><code> ----------
   |   btn  |
   ----------
   |   btn2 |
   ----------
   |        |
   ----------
   |        |
   ----------
  </code></pre>