title: How do I get the width & height of each grid cell in GridBagLayout?
body: <p>Everywhere I look for help with GridBagLayout only helps with GridBagConstraints. I understand that part completely, it's the methods inside GridBagLayout that confuse me.</p>
  
  <p>So I realized that the fields columnWidths and rowHeights are for overriding GridBagLayout's cell widths and heights, and are null until set by user. (I have implemented those fields in my program below) So how do I get the ACTUAL width and height of the cell?</p>
  
  <p><a href="https://i.stack.imgur.com/pzUE4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pzUE4.png" alt="enter image description here"></a></p>
  
  <p>I'm basically trying to override the paint method of the container in order to draw a grid that show where each cell begins and ends (where gridwidth and gridheight is irrelevant). The one thing that looks applicable is getLayoutInfo(Container parent, int sizeflag), but GridBagLayoutInfo has no methods or fields, and I have no idea what it means by sizeflag. </p>
  
  <p>EDIT:
  This is basically the grid I would like to draw, but of course I want to make sure it would work on any container where gridlayout is the layout manager. These are the actual gridx and gridy coordinates highlighted in red. I just don't know how to get the values I need to the paint method.
  <a href="https://i.stack.imgur.com/AWmeb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AWmeb.png" alt="enter image description here"></a></p>