本文整理汇总了Java中java.awt.MenuBar.setHelpMenu方法的典型用法代码示例。如果您正苦于以下问题:Java MenuBar.setHelpMenu方法的具体用法?Java MenuBar.setHelpMenu怎么用?Java MenuBar.setHelpMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.MenuBar
的用法示例。
在下文中一共展示了MenuBar.setHelpMenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例3: test4
import java.awt.MenuBar; //导入方法依赖的package包/类
private static void test4(final MenuBar menuBar) {
final Menu helpMenu = new Menu("Help Menu");
menuBar.setHelpMenu(helpMenu);
checkCurrentMenu(menuBar, helpMenu);
checkMenuCount(menuBar, 1);
checkHelpMenu(helpMenu, true);
menuBar.setHelpMenu(null);
checkCurrentMenu(menuBar, null);
checkMenuCount(menuBar, 0);
checkHelpMenu(helpMenu, false);
}
示例4: PartnerFrame
import java.awt.MenuBar; //导入方法依赖的package包/类
public PartnerFrame (String name, boolean serving)
{
super(name);
JPanel p = new MyPanel();
Serving = serving;
MenuBar menu = new MenuBar();
setMenuBar(menu);
Menu help = new MyMenu(Global.resourceString("Help"));
help.add(new MenuItemAction(this, Global
.resourceString("Partner_Connection")));
menu.setHelpMenu(help);
p.setLayout(new BorderLayout());
p
.add(
"Center",
Output = Global.getParameter("systemviewer", false)?new SystemViewer()
:new Viewer());
Output.setFont(Global.Monospaced);
p.add("South", Input = new HistoryTextField(this, "Input"));
add("Center", p);
JPanel p1 = new MyPanel();
p1.add(new ButtonAction(this, Global.resourceString("Game")));
p1.add(new ButtonAction(this, Global.resourceString("Restore_Game")));
add("South", new Panel3D(p1));
PGF = null;
Block = false;
Dir = "";
Moves = new ListClass();
seticon("iconn.gif");
}
示例5: ChannelDialog
import java.awt.MenuBar; //导入方法依赖的package包/类
public ChannelDialog (ConnectionFrame cf, PrintWriter out, int n,
ChannelDistributor mdis)
{
super(Global.resourceString("Channel"));
CF = cf;
MDis = mdis;
N = n;
CF.addCloseListener(this);
setLayout(new BorderLayout());
MenuBar M = new MenuBar();
Menu help = new MyMenu(Global.resourceString("Help"));
help.add(new MenuItem(Global.resourceString("Channels")));
M.setHelpMenu(help);
add("North", new MyLabel(Global.resourceString("Channel_") + n));
MyPanel pm = new MyPanel();
pm.setLayout(new BorderLayout());
pm.add("Center", T = new MyTextArea("", 0, 0,
TextArea.SCROLLBARS_VERTICAL_ONLY));
pm.add("South", Answer = new HistoryTextField(this, "Answer"));
add("Center", pm);
MyPanel pb = new MyPanel();
pb.add(new ButtonAction(this, Global.resourceString("Close")));
add("South", new Panel3D(pb));
Out = out;
seticon("iwho.gif");
Global.setwindow(this, "channeldialog", 500, 400);
validate();
show();
}