Java JMenu findMenuItem(JMenu menu, String menuItemName)

Here you can find the source of findMenuItem(JMenu menu, String menuItemName)

Description

find Menu Item

License

Open Source License

Declaration

public static JMenuItem findMenuItem(JMenu menu, String menuItemName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JMenu;

import javax.swing.JMenuItem;

public class Main {
    public static JMenuItem findMenuItem(JMenu menu, String menuItemName) {
        if (menu.getItemCount() > 0) {
            for (int ii = 0; ii < menu.getItemCount(); ++ii) {
                JMenuItem menuItem = menu.getItem(ii);
                if (menuItem.getText().equals(menuItemName))
                    return menuItem;
            }/*from   w ww . j  a v  a2s .  c o m*/
        }
        return null;
    }
}

Related

  1. createTooltiplessJMenu(Action action)
  2. disableMenuIfAllMenuItemsAreDisabled(JMenu menu, boolean bRemoveEmptySubMenus)
  3. enableAll(JMenu menu)
  4. fillFontMenu(JMenu fontMenu)
  5. findMenuComponent(JMenu menu, String menuComponentName, Class componentClass)
  6. findMenuItemByActionCommand(JMenu menu, String sActionCommand)
  7. findSubMenuWithLabel(JMenu menu, String text)
  8. fixJMenuBug()
  9. getMenu(JMenu poMenu, String psComando, boolean pbRecurs)