title: Placing GridLayout JPanels onto a GridBagLayout JFrame
body: <p>I'm trying to place two JPanels onto a JFrame using GridBagLayout. 
  The first JPanel uses gridLayout to create 35 columns and 27 rows of JButtons, and should have a width of 3/4 of the JFrame. This panel needs to fill the vertical space available to it.
  The second JPanel also uses gridLayout and should fill the last 1/4 of the main JFrame. </p>
  
  <p>Unfortunately, my first JPanel (sPan) isn't even fitting properly on the screen, and is forcing the whole second JPanel (cPan) off of the screen. How can I constrain these values to take up only their allowed proportion on the screen without them moving each other around? </p>
  
  <p>If I use a blank JPanel with a background colour with my code, everything works out perfectly fine:</p>
  
  <p><a href="https://i.stack.imgur.com/d4Jzq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d4Jzq.png" alt="Blank JPanel proportions"></a>
  [1]</p>
  
  <p>However, when I use my JPanel consisting of JButtons, the proportions get completely messed up:</p>
  
  <p><a href="https://i.stack.imgur.com/AwUfs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AwUfs.png" alt="JButtons JPanel proportions"></a>
  [2]</p>
  
  <p>I speculate that when I instantiate my sPan object, it's sizing each button to accommodate the size of the whole JFrame. Then when I instantiate the cPan object and try to place it next to the sPan object, the buttons aren't resizing themselves to accommodate the additional panel in the main JFrame. Does anybody know how I can fix this?</p>
  
  <p>I have to use GridBagLayout for this assignment, so using normal gridLayout isn't an option.
  Any tips regarding what's happening would be appreciated.</p>