Here you can find the source of getTextByJMenu(List
Parameter | Description |
---|---|
lstMenus | a parameter |
public static Map<String, Integer> getTextByJMenu(List<JMenu> lstMenus)
//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; } }