title: Remove last row from JPanel set with GridLayout
body: <p>I have a <code>JPanel</code> which has <code>GridLayout</code> as the layout. I have a plus button at the end of the Main Panel to add some panels to the grid. I need a minus button that subsequently removes the last row added to the grid.</p>
  
  <p>I saw the docs related and it shows <code>removeAll()</code> method, which is not useful for me as I need to remove only the last row.</p>
  
  <p>Also it shows some <code>remove(int index)</code>. Again I am unaware of the index of the last row, though I tried doing this:</p>
  
  <pre><code>myPanel.remove(0);
  </code></pre>
  
  <p>but this removes the first row.</p>