title: How to refresh a panel?
body: <p>I have a JMenu and when a person clicks on a JMenuItem I want the middle panel to refresh and display some new stuff. So I tried the .removeAll which works fine but when I try to add something it wont show.</p>
  <p><strong>Note: I'm using the WindowBuilder PRO, so I still trying to get use to it and whatnot</strong></p>
  <p>Here is my code:</p>
  <pre><code>import java.awt.EventQueue;
  import javax.swing.JFrame;
  import javax.swing.JMenuBar;
  import javax.swing.JMenuItem;
  import javax.swing.JCheckBoxMenuItem;
  import javax.swing.JMenu;
  import javax.swing.JOptionPane;
  import javax.swing.JPanel;
  import javax.swing.JTextField;
  import javax.swing.SpringLayout;
  
  import java.awt.List;
  import javax.swing.JLabel;
  import javax.swing.JTextPane;
  import javax.swing.JSeparator;
  import org.eclipse.wb.swing.FocusTraversalOnArray;
  import java.awt.Component;
  import java.awt.Container;
  import java.awt.FlowLayout;
  import java.awt.Font;
  import java.awt.GridBagLayout;
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.awt.Panel;
  import java.awt.GridBagConstraints;
  
  
  public class HomeScreen {
  
  JFrame frame;
  private final Panel panel = new Panel();
  
  public HomeScreen(String name) {
      initialize(name);
  }
  
  /**
   * Initialize the contents of the frame.
   */
  private void initialize(String name) {
      frame = new JFrame(&quot;Timzys CMS / Monitor / Account( &quot; + name + &quot; )&quot;);
      frame.setResizable(false);
      frame.setSize(694,525);
      frame.setLocationRelativeTo(null);
      
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      
      JMenuBar menuBar = new JMenuBar();
      frame.setJMenuBar(menuBar);
      
      JMenu mnMonitor = new JMenu(&quot;Monitor&quot;);
      menuBar.add(mnMonitor);
      
      JMenuItem mntmUsers = new JMenuItem(&quot;Users&quot;);
      mnMonitor.add(mntmUsers);
      
      JMenuItem mntmContentPosts = new JMenuItem(&quot;Content Posts&quot;);
      mnMonitor.add(mntmContentPosts);
      
      JMenuItem mntmLogs = new JMenuItem(&quot;Logs&quot;);
      mnMonitor.add(mntmLogs);
      
      JMenu mnExtras = new JMenu(&quot;Extras&quot;);
      menuBar.add(mnExtras);
      
      mntmUsers.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e)
          {
               frame.getContentPane().removeAll();
          
               frame.getContentPane().add(new JLabel(&quot;Test&quot;));
               frame.getContentPane().revalidate();
              
          }
      });
      
      
      JMenuItem mntmFeedbacksuggestions = new JMenuItem(&quot;Feedback/Suggestions&quot;);
      mnExtras.add(mntmFeedbacksuggestions);
      frame.getContentPane().setLayout(null);
      panel.setBounds(0, 0, 688, 476);
      frame.getContentPane().add(panel);
      panel.setLayout(null);
      
      JTextPane txtpnWelcomeTimzysCms = new JTextPane();
      txtpnWelcomeTimzysCms.setFont(new Font(&quot;Arial&quot;, Font.PLAIN, 18));
      txtpnWelcomeTimzysCms.setEditable(false);
      txtpnWelcomeTimzysCms.setText(&quot;Welcome Timzys CMS Monitor. If you are here then you are a admin! So please do not tamper with any important things. If you have questions or suggestions goto the extras tab and submit a feedback idea. Enjoy!&quot;);
      txtpnWelcomeTimzysCms.setBounds(10, 11, 668, 72);
      panel.add(txtpnWelcomeTimzysCms);
  
   }
  }
  </code></pre>