title: Calling class with swing menu and menuitem objects
body: <p>I need your help :). This is my first post here. I am trying to create a menu bar as a seperate class for my JFrame that I will call from separate class MainBar. How can I do that? I tried with the code listed below and calling new MainBar() but I always get just my JFrame with Menu without items on it.</p>
  
  <p>Do I miss a return statement here? All tips are appreciated. Thanks!</p>
  
  <pre><code>public class MainBar extends JMenu{
  
      public  MainBar() { //What is return from this method? Component?
  
  
      // Bar Menu
      final WebMenuBar mainBar = new WebMenuBar();
      mainBar.setMenuBarStyle(MenuBarStyle.standalone);
  
      // Bar Menu Items
      JMenu fileMenu = new JMenu("File");
      JMenuItem exitMenuItem = new JMenuItem("Exit");
      fileMenu.add(exitMenuItem);
  
      JMenu editMenu = new JMenu("Edit");
      JMenuItem cutMenuItem = new JMenuItem("Cut");
      editMenu.add(cutMenuItem);
      JMenuItem copyMenuItem = new JMenuItem("Copy");
      editMenu.add(copyMenuItem);
  
      JMenu viewMenu = new JMenu("View");
      JMenu settingsMenu = new JMenu("Settings");
      JMenu helpMenu = new JMenu("Help");
  
      // adding menu items to bar menu
      mainBar.add(fileMenu);
      mainBar.add(editMenu);
      mainBar.add(viewMenu);
      mainBar.add(settingsMenu);
      mainBar.add(helpMenu);
  
     // should I put here return statement like return mainBar; ?
  }
  </code></pre>
  
  <p>}</p>