Java JMenu createMenuBar(JMenu... menues)

Here you can find the source of createMenuBar(JMenu... menues)

Description

create Menu Bar

License

Open Source License

Declaration

static JMenuBar createMenuBar(JMenu... menues) 

Method Source Code

//package com.java2s;
/*/*from w w  w . j  a  va  2s .  com*/
Formulae - Free Expressions
Copyright (C) Laurence R. Ugalde - laurence@formulae.org
formulae.org
    
This file is part of Formulae front-end "Desktop".
    
Formulae Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
    
Formulae Desktop is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with Formulae Desktop. If not, see <http://www.gnu.org/licenses/>.
*/

import javax.swing.JMenu;

import javax.swing.JMenuBar;

public class Main {
    static JMenuBar createMenuBar(JMenu... menues) {
        JMenuBar menuBar = new JMenuBar();

        for (JMenu menu : menues) {
            menuBar.add(menu);
        }

        return menuBar;
    }
}

Related

  1. changeMenuItemsState(final JMenu menu, final boolean enableState)
  2. constructRecentlyFilesMenuItems(JMenu recentlyOpenFilesMenuItem, LinkedHashMap filesOpenedLHM)
  3. containsMenuComponent(JMenu parent, Component comp)
  4. countCheckBoxMenuItem(JMenu menu)
  5. createMenu(String menuText, JMenu menu, ActionListener listener)
  6. createMenuItem(JMenu parent, String text)
  7. createMenuItemCustomAction(JMenu menu, int type, String text, String command, ImageIcon image, int acceleratorKey, String toolTip, ActionListener action)
  8. createMenuItems(JMenu menu, String[] menuItemNames)
  9. createTooltiplessJMenu(Action action)