title: Java Swing: How can I change the size of one row in a Grid layout and allow it to resize dynamically only horizontally and not vertically?
body: <p>Hi everyone I have a JFrame which has three components inside.</p>
  
  <ol>
  <li>A menu</li>
  <li>A tabbed pane</li>
  <li>a panel that has some buttons</li>
  </ol>
  
  <p>Initially my goal was to create a design like the following:
  <img src="https://i.stack.imgur.com/OBKYC.png" alt="enter image description here"></p>
  
  <p>when the user would resize the application, everything would be resized as well. So I thought maybe if I used a simple grid layout my problem would be solved, so I decided to do the following:</p>
  
  <ol>
  <li><p>The tabbed pane will have some panels inside and those panels will follow the grid layout.</p></li>
  <li><p>the Panel at the bottom will follow the grid layout.</p></li>
  <li><p>the JFrame will follow the grid layout as well.</p></li>
  </ol>
  
  <p>Results:</p>
  
  <p><img src="https://i.stack.imgur.com/ydhsb.png" alt="enter image description here"></p>
  
  <p>As you can see this is not what I wanted, the buttons are too big and although the application resizes very well:</p>
  
  <p><img src="https://i.stack.imgur.com/X4vaK.png" alt="enter image description here"></p>
  
  <p>The buttons resize as well but they remain too big. I would like to be able to set a small size for the buttons(more specifically the panel they are contained in) and when the user resizes the application, the buttons would resize only horizontally never vertically which means that ONLY the tabbed pane would grow bigger vertically.
    Is this achievable? I searched and found out about gridbaglayout, I started playing a little bit, but I didn't achieve anything. All I managed to do is the following:</p>
  
  <p><img src="https://i.stack.imgur.com/sQZm4.png" alt="enter image description here"></p>
  
  <p>seems good, but when I resize this is what I get:</p>
  
  <p><img src="https://i.stack.imgur.com/8cPfA.png" alt="enter image description here"></p>
  
  <p>thanks in advance.</p>