Java JMenu getTextByJMenu(List lstMenus)

Here you can find the source of getTextByJMenu(List lstMenus)

Description

get the text of menus from a given list of menus

License

Open Source License

Parameter

Parameter Description
lstMenus a parameter

Declaration

public static Map<String, Integer> getTextByJMenu(List<JMenu> lstMenus) 

Method Source Code

//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.JMenu;

public class Main {
    /**/*from w ww  .  ja v a  2  s. com*/
     * get the text of menus from a given list of menus
     * @param lstMenus
     * @return
     */
    public static Map<String, Integer> getTextByJMenu(List<JMenu> lstMenus) {
        Map<String, Integer> mpMenus = new HashMap<String, Integer>();
        for (int i = 0; i < lstMenus.size(); i++)
            mpMenus.put(lstMenus.get(i).getText(), i);

        return mpMenus;
    }
}

Related

  1. fixJMenuBug()
  2. getMenu(JMenu poMenu, String psComando, boolean pbRecurs)
  3. getMenuItem(JMenu menu, String text)
  4. getMenuItemIndex(JMenu menu, String menuItemText)
  5. getMenuItems(JMenu menu)
  6. insertSeparatorIfNeeded(JMenu menu, int position)
  7. isAtLeastOneChildComponentVisible(JMenu menu)
  8. limitMenuSize(JMenu menu, String name, int size)
  9. makeMenu(JMenu menu, List menuItems)