当前位置: 首页>>代码示例>>Java>>正文


Java MenuBar.getMenuCount方法代码示例

本文整理汇总了Java中java.awt.MenuBar.getMenuCount方法的典型用法代码示例。如果您正苦于以下问题:Java MenuBar.getMenuCount方法的具体用法?Java MenuBar.getMenuCount怎么用?Java MenuBar.getMenuCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.MenuBar的用法示例。


在下文中一共展示了MenuBar.getMenuCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addMenus

import java.awt.MenuBar; //导入方法依赖的package包/类
/**
 * Recurses the menubar adding menus (and menu items),
 * called from the Frame peer.
 */
void addMenus()
{
  MenuBar o = (MenuBar)owner;
  int help = (o.getHelpMenu() != null) ? 1 : 0;
  for (int i = 0; i < o.getMenuCount() - help; i++)
    addMenu( o.getMenu(i) );
   if(o.getHelpMenu() != null)
     addHelpMenu( o.getHelpMenu() );
}
 
开发者ID:vilie,项目名称:javify,代码行数:14,代码来源:QtMenuBarPeer.java

示例2: SwingMenuBarPeer

import java.awt.MenuBar; //导入方法依赖的package包/类
/**
 * Creates a new <code>SwingMenuBarPeer</code> instance.
 *
 * @param awtMenuBar the AWT menu bar
 */
public SwingMenuBarPeer(MenuBar awtMenuBar)
{
  this.awtMenuBar = awtMenuBar;
  menuBar = new SwingMenuBar();
  menuBar.setDoubleBuffered(false);
  // Add all the menus that are already in the MenuBar.
  for (int i = 0; i < awtMenuBar.getMenuCount(); i++)
    {
      Menu menu = awtMenuBar.getMenu(i);
      menu.addNotify();
      addMenu(awtMenuBar.getMenu(i));
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:SwingMenuBarPeer.java

示例3: setBookOpened

import java.awt.MenuBar; //导入方法依赖的package包/类
public void setBookOpened() {
    indexPanel.setVisible(true);
    MenuBar bar = getMenuBar();
    for(int i = 0; i < bar.getMenuCount(); i++) {
        enableMenu(bar.getMenu(i));
    }
}
 
开发者ID:Martin-Dames,项目名称:Tingeltangel,代码行数:8,代码来源:EditorFrame.java

示例4: addMenus

import java.awt.MenuBar; //导入方法依赖的package包/类
/** 
 * Recurses the menubar adding menus (and menu items), 
 * called from the Frame peer.
 */
void addMenus()
{
  MenuBar o = (MenuBar)owner;
  int help = (o.getHelpMenu() != null) ? 1 : 0;
  for (int i = 0; i < o.getMenuCount() - help; i++)
    addMenu( o.getMenu(i) );
   if(o.getHelpMenu() != null)
     addHelpMenu( o.getHelpMenu() );
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:14,代码来源:QtMenuBarPeer.java

示例5: setMenubar

import java.awt.MenuBar; //导入方法依赖的package包/类
/**
 * Set a custom menu bar to the viewer.
 * 
 * @deprecated Use swing instead.
 */
@Deprecated
public void setMenubar(final MenuBar mb) {
	final JMenuBar jmb = new JMenuBar();
	final int num = mb.getMenuCount();
	for (int i = 0; i < num; i++)
		jmb.add(menuToJMenu(mb.getMenu(i)));

	setMenubar(jmb);
}
 
开发者ID:fiji,项目名称:3D_Viewer,代码行数:15,代码来源:Image3DUniverse.java

示例6: restoreMenuBar

import java.awt.MenuBar; //导入方法依赖的package包/类
/**Restore ImageJ's MenuBar*/
static public final void restoreMenuBar() {
	final MenuBar menu_bar = Menus.getMenuBar();
	final int n_menus = menu_bar.getMenuCount();
	for (int i=0; i<n_menus;i++) {
		final Menu menu = menu_bar.getMenu(i);
		restoreMenu(menu);
	}
	//make sure there isn't a null menu bar
	//WindowManager.getCurrentWindow().setMenuBar(menu_bar);
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:12,代码来源:Utils.java

示例7: checkMenuCount

import java.awt.MenuBar; //导入方法依赖的package包/类
private static void checkMenuCount(final MenuBar bar, final int expected) {
    final int actual = bar.getMenuCount();
    if (actual != expected) {
        throw new RuntimeException("Incorrect menus count");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:RemoveHelpMenu.java


注:本文中的java.awt.MenuBar.getMenuCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。