Java JMenuBar createMenuInMenuBar(final JMenuBar menuBar, final String menuName)

Here you can find the source of createMenuInMenuBar(final JMenuBar menuBar, final String menuName)

Description

Adds a menu to the specified menu bar.

License

BSD License

Parameter

Parameter Description
menuBar a parameter
menuName a parameter

Declaration

public static JMenu createMenuInMenuBar(final JMenuBar menuBar, final String menuName) 

Method Source Code

//package com.java2s;
// LICENSE:      This file is distributed under the BSD license.

import javax.swing.*;

public class Main {
    /**/*from  w w w. ja  va2s . c  om*/
     * Adds a menu to the specified menu bar.
     * @param menuBar
     * @param menuName
     * @return 
     */
    public static JMenu createMenuInMenuBar(final JMenuBar menuBar, final String menuName) {
        final JMenu menu = new JMenu();
        menu.setText(menuName);
        menuBar.add(menu);
        return menu;
    }
}

Related

  1. addFastKeys(JMenuBar menuBar)
  2. addMenuItems(JMenuBar menu, JComponent... items)
  3. applyDefaultProperties(final JMenuBar comp)
  4. cloneMenuBar(final JMenuBar menubar)
  5. findItem(JMenuBar menuBar, String menuName, String menuItemName)
  6. findMenu(JMenuBar bar, Class type)
  7. findMenu(JMenuBar menuBar, String menuName)
  8. findMenu(JMenuBar menuBar, String menuName, String subMenuName)