title: JFrame reloads initial content on mouse over
body: <p>I have a <code>JPanel</code> with a <code>GridLayout(1,0)</code> set to a <code>JFrame</code> <code>Borderlayout.SOUTH</code>, there are placed a couple of buttons in here (when pressed they change a variables value to the index of the created button). </p>
  
  <p>Everything is added correctly, but when I try to update the <code>JPanel</code> it does work at first (only when window is maximized). But then when I go over a button (or all the buttons) it goes back to what the original content of the panel.</p>
  
  <p>I've tried <code>invalidate</code>, <code>validate</code>, <code>repaint</code>, <code>jframe.setvisible(true)</code> - none of these seem to work properly.</p>
  
  <p>Any ideas?</p>
  
  <pre><code> private void toonHand(){
          JPanel pnlSouth = new JPanel(new GridLayout(1,0));
          JButton[] btnArr =new JButton[50];
          ArrayList&lt;Kaart&gt; Thand=uno.getSpeler(0).getHand();
          for(int i=0;i&lt;Thand.size();i++){
              final int T=i;
              btnArr[i]=new JButton();
              btnArr[i].setIcon(Thand.get(i).getImg());
              btnArr[i].addActionListener(new ActionListener() {
                  public void actionPerformed(ActionEvent e) {
                      iKaart=T;
                  }
              });
              pnlSouth.add(btnArr[i]);
          }
          Hoofdvenster.remove(pnlSouth);
          Hoofdvenster.add(pnlSouth, BorderLayout.SOUTH);
      }
  </code></pre>