Java Swing Menu getTheMenuBar(String[][] arr)

Here you can find the source of getTheMenuBar(String[][] arr)

Description

get The Menu Bar

License

LGPL

Declaration

public static JMenuBar getTheMenuBar(String[][] arr) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

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

public class Main {

    public static JMenuBar getTheMenuBar(String[][] arr) {
        JMenuBar jmb = new JMenuBar();
        JMenu jm;//  w  w  w . j a  v  a  2s.com
        JMenuItem jmi;
        for (int i = 0; i < arr.length; i++) {
            jm = new JMenu(arr[i][0]);
            for (int j = 1; j < arr[i].length; j++) {
                jmi = new JMenuItem(arr[i][j]);
                jm.add(jmi);
            }
            jmb.add(jm);
        }
        return jmb;
    }
}

Related

  1. getMenuFontHeight()
  2. getMenuKeyStroke(String stroke)
  3. getMenuSectionLabel(String string)
  4. getOperationMenu(MenuElement currentMenu, String path)
  5. getParsedElements(MenuElement[] elements)
  6. hasIcons(MenuElement menuElement)
  7. installMenuKeyListener(Component cmp, MenuKeyListener keyListener)
  8. isMenuCrossMenuMnemonics()
  9. limitMenuSize(List items, String name, int size)