本文整理了Java中java.awt.PopupMenu.add()
方法的一些代码示例,展示了PopupMenu.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupMenu.add()
方法的具体详情如下:
包路径:java.awt.PopupMenu
类名称:PopupMenu
方法名:add
暂无
代码示例来源:origin: RipMeApp/ripme
configClipboardAutorip.setSelected(trayMenuAutorip.getState());
});
trayMenu.add(trayMenuMain);
trayMenu.add(trayMenuAbout);
trayMenu.addSeparator();
trayMenu.add(trayMenuAutorip);
trayMenu.addSeparator();
trayMenu.add(trayMenuExit);
try {
mainIcon = ImageIO.read(getClass().getClassLoader().getResource("icon.png"));
代码示例来源:origin: stackoverflow.com
popup.add(defaultItem);
代码示例来源:origin: com.h2database/h2
itemConsole.addActionListener(this);
itemConsole.setFont(font);
menuConsole.add(itemConsole);
MenuItem itemStatus = new MenuItem("Status");
itemStatus.setActionCommand("status");
itemStatus.addActionListener(this);
itemStatus.setFont(font);
menuConsole.add(itemStatus);
MenuItem itemExit = new MenuItem("Exit");
itemExit.setFont(font);
itemExit.setActionCommand("exit");
itemExit.addActionListener(this);
menuConsole.add(itemExit);
代码示例来源:origin: igniterealtime/Openfire
menu.add(showMenuItem);
menu.add(startMenuItem);
menu.add(stopMenuItem);
menu.add(browserMenuItem);
menu.add(quitMenuItem);
代码示例来源:origin: i2p/i2p.i2p
public PopupMenu getMainMenu() {
PopupMenu popup = new PopupMenu();
MenuItem startItem = new MenuItem(_t("Start I2P"));
startItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
new SwingWorker<Object, Object>() {
@Override
protected Object doInBackground() throws Exception {
RouterManager.start();
return null;
}
@Override
protected void done() {
trayIcon.displayMessage(_t("Starting"), _t("I2P is starting!"), TrayIcon.MessageType.INFO);
//Hide the tray icon.
//We cannot stop the desktopgui program entirely,
//since that risks killing the I2P process as well.
tray.remove(trayIcon);
}
}.execute();
}
});
popup.add(startItem);
return popup;
}
代码示例来源:origin: Nilhcem/FakeSMTP
/**
* The popup menu used by the icon in the system tray.
*
* @param mainFrame MainFrame class.
*/
public TrayPopup(final MainFrame mainFrame) {
// Create a popup menu components
MenuItem aboutItem = new MenuItem(i18n.get("menubar.about"));
aboutItem.addActionListener(new AboutActionListener(null));
MenuItem exitItem = new MenuItem(i18n.get("menubar.exit"));
exitItem.addActionListener(new ExitActionListener(mainFrame));
popup.add(aboutItem);
popup.addSeparator();
popup.add(exitItem);
}
代码示例来源:origin: net.imagej/ij
private void addItem(String name) {
CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet));
item.addItemListener(this);
switchPopup.add(item);
}
代码示例来源:origin: i2p/i2p.i2p
popup.add(statusItem);
popup.addSeparator();
if (CONSOLE_ENABLED) {
popup.add(browserLauncher);
popup.addSeparator();
desktopguiConfigurationLauncher.add(configSubmenu);
popup.add(desktopguiConfigurationLauncher);
popup.addSeparator();
if (_context.hasWrapper())
popup.add(restartItem);
popup.add(stopItem);
if (_context.hasWrapper())
popup.add(restartItem2);
popup.add(stopItem2);
popup.add(cancelItem);
代码示例来源:origin: net.imagej/ij
void addPopupItem(String s) {
MenuItem mi=new MenuItem(s);
mi.addActionListener(this);
pm.add(mi);
}
代码示例来源:origin: magefree/mage
popup.add(imagesItem);
popup.add(iconsItem);
popup.add(stopBlinkItem);
popup.add(preferencesItem);
popup.addSeparator();
popup.add(aboutItem);
popup.addSeparator();
popup.add(exitItem);
代码示例来源:origin: net.imagej/ij
void addPopupItem(String s) {
MenuItem mi=new MenuItem(s);
mi.addActionListener(this);
pm.add(mi);
}
代码示例来源:origin: net.imagej/ij
void addPopupItem(String s) {
MenuItem mi=new MenuItem(s);
mi.addActionListener(this);
pm.add(mi);
}
代码示例来源:origin: org.activecomponents.jadex/jadex-applications-bdiv3
public void actionPerformed(ActionEvent e)
{
// tray.remove(ti);
menu.remove(rft);
menu.add(stt);
setVisible(true);
}
});
代码示例来源:origin: imagej/ImageJA
void addPopupItem(String s) {
MenuItem mi=new MenuItem(s);
mi.addActionListener(this);
pm.add(mi);
}
代码示例来源:origin: org.activecomponents.jadex/jadex-applications-bdi
public void actionPerformed(ActionEvent e)
{
// tray.remove(ti);
menu.remove(rft);
menu.add(stt);
setVisible(true);
}
});
代码示例来源:origin: imagej/ImageJA
void addPopupItem(String s) {
MenuItem mi=new MenuItem(s);
mi.addActionListener(this);
pm.add(mi);
}
代码示例来源:origin: net.imagej/ij
private void addPluginTool(String name) {
CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet));
item.addItemListener(this);
item.setActionCommand("Plugin Tool");
switchPopup.add(item);
}
代码示例来源:origin: net.imagej/ij
private void addBuiltInTool(String name) {
CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet));
item.addItemListener(this);
item.setActionCommand("Tool");
switchPopup.add(item);
}
代码示例来源:origin: imagej/ImageJA
private void addBuiltInTool(String name) {
CheckboxMenuItem item = new CheckboxMenuItem(name, name.equals(currentSet));
item.addItemListener(this);
item.setActionCommand("Tool");
switchPopup.add(item);
}
代码示例来源:origin: net.imagej/ij
MenuItem addPopupItem(PopupMenu popupMenu, String s, boolean isCheckboxItem) {
MenuItem mi = null;
if (isCheckboxItem) {
mi = new CheckboxMenuItem(s);
((CheckboxMenuItem)mi).addItemListener(this);
} else {
mi = new MenuItem(s);
mi.addActionListener(this);
}
popupMenu.add(mi);
return mi;
}
内容来源于网络,如有侵权,请联系作者删除!