title: Eclipse not displaying JMenu items after adding to and setting JMenuBar visible?
body: <p>Not getting any errors however the program only displays the word "menu" at the top in the program. It doesn't display the 3 <code>JMenu</code> items: "home", "about" and "explore". </p>
  
  <pre><code>JPanel p5 = new JPanel(new GridBagLayout());
                  p5.setVisible(true);
                  fw.add(p5, BorderLayout.PAGE_START);
  
                  JMenu menu = new JMenu("Menu");
                  menu.setVisible(true);
                  menu.add("home");
                  menu.add("about");
                  menu.add("explore");
  
                  JMenuBar menubar = new JMenuBar();
                  fw.setJMenuBar(menubar); //ADDED THIS LINE. STILL DOESN'T WORK. 
  
                  menubar.setVisible(true);
                  menubar.add(menu);
                  p5.add(menu);
  </code></pre>
  
  <p>I've added <code>JMenu</code> to <code>JMenuBar</code> (everything <code>JMenu</code>, <code>JMenubar</code> and <code>JPanel</code> is set to visible). Also I added JPanel (p5) to "first window (fw) and added menu to p5. I'm not sure why my menu items are not being displayed.</p>
  
  <p><strong>UPDATE:</strong>  MCVE (Minimal Complete and Verifiable Example) as requested. </p>
  
  <pre><code>import javax.swing.JFrame;
  import javax.swing.JMenu;
  import javax.swing.JMenuBar;
  import javax.swing.JPanel;  
  public class TestingClass  extends JFrame {
  
      public static void main(String[] args) {
  
          FirstWindow fw = new FirstWindow();
          fw.setSize(400, 600);
          fw.setDefaultCloseOperation(EXIT_ON_CLOSE);         
          fw.setVisible(true);
  
          JPanel p5 = new JPanel(new GridBagLayout());
          p5.setVisible(true);
  
          fw.add(p5);
  
          JMenu menu = new JMenu("Menu");
          menu.setVisible(true);
          menu.add("home");
          menu.add("about");
          menu.add("explore");
  
          JMenuBar menubar = new JMenuBar();
          fw.setJMenuBar(menubar);    // THE UPDATED LINE OF CODE.
          menubar.setVisible(true);
          menubar.add(menu);
          p5.add(menu);
        } 
      }
  </code></pre>
  
  <p>As you run the program, you will see the words "menu" displayed. The items: "home, about and explore" from <code>JMenu</code> are not displayed. Does anybody know what I'm doing wrong? </p>