Java JMenu getMenuItems(JMenu menu)

Here you can find the source of getMenuItems(JMenu menu)

Description

get Menu Items

License

Open Source License

Declaration

public static JMenuItem[] getMenuItems(JMenu menu) 

Method Source Code

//package com.java2s;
/*//from   www.ja  v  a2s.  c  om
 * Copyright 2001-2008 Aqris Software AS. All rights reserved.
 * 
 * This program is dual-licensed under both the Common Development
 * and Distribution License ("CDDL") and the GNU General Public
 * License ("GPL"). You may elect to use one or the other of these
 * licenses.
 */

import javax.swing.JMenu;
import javax.swing.JMenuItem;

public class Main {
    public static JMenuItem[] getMenuItems(JMenu menu) {
        JMenuItem[] result = new JMenuItem[menu.getItemCount()];

        for (int i = 0; i < result.length; i++) {
            result[i] = menu.getItem(i);
        }

        return result;
    }
}

Related

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