本文整理汇总了Java中java.awt.MenuBar.remove方法的典型用法代码示例。如果您正苦于以下问题:Java MenuBar.remove方法的具体用法?Java MenuBar.remove怎么用?Java MenuBar.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.MenuBar
的用法示例。
在下文中一共展示了MenuBar.remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test3
import java.awt.MenuBar; //导入方法依赖的package包/类
private static void test3(final MenuBar menuBar) {
final Menu helpMenu1 = new Menu("Help Menu1");
final Menu helpMenu2 = new Menu("Help Menu2");
menuBar.setHelpMenu(helpMenu1);
checkCurrentMenu(menuBar, helpMenu1);
checkMenuCount(menuBar, 1);
checkHelpMenu(helpMenu1, true);
checkHelpMenu(helpMenu2, false);
menuBar.setHelpMenu(helpMenu2);
checkCurrentMenu(menuBar, helpMenu2);
checkMenuCount(menuBar, 1);
checkHelpMenu(helpMenu1, false);
checkHelpMenu(helpMenu2, true);
menuBar.remove(helpMenu2);
checkCurrentMenu(menuBar, null);
checkMenuCount(menuBar, 0);
checkHelpMenu(helpMenu1, false);
checkHelpMenu(helpMenu2, false);
}
示例2: test2
import java.awt.MenuBar; //导入方法依赖的package包/类
private static void test2(final MenuBar menuBar) {
final Menu helpMenu = new Menu("Help Menu");
menuBar.setHelpMenu(helpMenu);
checkCurrentMenu(menuBar, helpMenu);
checkMenuCount(menuBar, 1);
checkHelpMenu(helpMenu, true);
menuBar.remove(helpMenu);
checkCurrentMenu(menuBar, null);
checkMenuCount(menuBar, 0);
checkHelpMenu(helpMenu, false);
}