title: Adding JButton dynamically to the JPanel not working with Netbeans
body: <p>I created a <code>JFrame Class</code> with <code>Netbeans 7.3</code> and added two panels from the palette.
  I have added a button in the first panel on the click of which I want to add a new button in the second panel(topoPane).</p>
  
  <p>Below is the button click event that I have written for the same. But, the button is not getting added to the panel even when the event is getting called.
  Please tell me what's wrong in it.</p>
  
  <pre><code>private void jButton1MouseClicked(java.awt.event.MouseEvent evt) 
  {                                      
      // TODO add your handling code here:
  
      System.out.println("Creating the Button");        
      JButton but = new JButton();
      but.setBackground(Color.red);
      but.setText("New Button");
      but.setBounds(500, 500, 500, 500);
  
      topoPane.add(but);
      topoPane.revalidate();
  
  }             
  </code></pre>