code: public static JMenuItem addMenuItem (
          ActionListener l, JMenu menu, String name, Integer mnem,
          KeyStroke accel)
      {
          JMenuItem item = createItem(name, mnem, accel);
          item.addActionListener(l);
          menu.add(item);
          return item;
      }
docs: Adds a new menu item to the menu with the specified name and
  attributes.
  
  @param l the action listener.
  @param menu the menu to add the item to.
  @param name the item name.
  @param mnem the mnemonic key for the item or null if none.
  @param accel the keystroke for the item or null if none.
  
  @return the new menu item.