本文整理了Java中java.awt.PopupMenu.<init>()
方法的一些代码示例,展示了PopupMenu.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupMenu.<init>()
方法的具体详情如下:
包路径:java.awt.PopupMenu
类名称:PopupMenu
方法名:<init>
暂无
代码示例来源:origin: igniterealtime/Openfire
PopupMenu menu = new PopupMenu(appName + " Menu");
代码示例来源:origin: RipMeApp/ripme
public void windowIconified(WindowEvent e) { trayMenuMain.setLabel("Show"); }
});
PopupMenu trayMenu = new PopupMenu();
trayMenuMain = new MenuItem("Hide");
trayMenuMain.addActionListener(arg0 -> toggleTrayClick());
代码示例来源:origin: stackoverflow.com
PopupMenu popup = new PopupMenu();
代码示例来源:origin: stackoverflow.com
PopupMenu popup=new PopupMenu();
MenuItem defaultItem=new MenuItem("Exit");
defaultItem.addActionListener(exitListener);
代码示例来源:origin: stackoverflow.com
PopupMenu popup = new PopupMenu();
代码示例来源:origin: com.h2database/h2
return false;
PopupMenu menuConsole = new PopupMenu();
MenuItem itemConsole = new MenuItem("H2 Console");
itemConsole.setActionCommand("console");
代码示例来源: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: stackoverflow.com
icon1 = new BevelArrowIcon(BevelArrowIcon.DOWN, false, false);
image1 = iconToImage(icon1);
PopupMenu popup = new PopupMenu();
MenuItem item = new MenuItem("Hello, World");
trayIcon = new TrayIcon(image, "Tip Text", popup);
代码示例来源:origin: stackoverflow.com
PopupMenu trayPopupMenu = new PopupMenu();
代码示例来源:origin: stackoverflow.com
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(about)){
new PopupMenu(this);
}
if(e.getSource().equals(rules)){
new RulesPopup();
}
}
代码示例来源:origin: stackoverflow.com
final SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().getImage("gifIcon.gif");
PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon = new TrayIcon(image, "The Tip Text", popup);
MenuItem item = new MenuItem("Error");
代码示例来源:origin: stackoverflow.com
final PopupMenu popup = new PopupMenu();
MenuItem aboutItem = new MenuItem("About");
CheckboxMenuItem cb1 = new CheckboxMenuItem("Set auto size");
代码示例来源:origin: stackoverflow.com
if (System.getProperty("os.name").startsWith("Mac OS X")) {
// only do this setup if we know this is a Mac
com.apple.eawt.Application macApp = com.apple.eawt.Application.getApplication();
java.awt.PopupMenu menu = new java.awt.PopupMenu();
// create your java.awt.MenuItem objects here
// add to menu via java.awt.Menu#add(java.awt.MenuItem)
macApp.setDockMenu(menu);
}
代码示例来源:origin: stackoverflow.com
final PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon =
new TrayIcon(createImage("images/bulb.gif", "tray icon"));
final SystemTray tray = SystemTray.getSystemTray();
// Populate popup menu
trayIcon.setPopupMenu(popup);
try {
tray.add(trayIcon);
} catch (AWTException e) {
System.out.println("TrayIcon could not be added.");
}
代码示例来源:origin: magefree/mage
final PopupMenu popup = new PopupMenu();
代码示例来源:origin: com.dorkbox/SystemTray
@SuppressWarnings("IncompleteCopyConstructor")
AwtMenu(final AwtMenu parent) {
this.parent = parent;
if (parent == null) {
this._native = new PopupMenu();
}
else {
this._native = new java.awt.Menu();
parent._native.add(this._native);
}
}
代码示例来源:origin: stackoverflow.com
...
PopupMenu p = new PopupMenu(this, null);
Menu menu = p.getMenu();
getMenuInflater().inflate(R.menu.some_menu, menu);
//Usage of menu
System.out.println("LOG id: "+ menu.getItem(0).getItemId());
System.out.println("LOG title: "+ menu.getItem(0).getTitle());
System.out.println("LOG icon: "+ menu.getItem(0).getIcon());
...
代码示例来源:origin: i2p/i2p.i2p
public synchronized PopupMenu getMainMenu() {
PopupMenu popup = new PopupMenu();
PopupMenu desktopguiConfigurationLauncher = new PopupMenu(_t("Configure I2P System Tray"));
MenuItem configSubmenu = new MenuItem(_t("Disable"));
configSubmenu.addActionListener(new ActionListener() {
代码示例来源:origin: net.imagej/ij
/** Prepares and returns the popupMenu of the Data>> button */
PopupMenu getDataPopupMenu() {
dataPopupMenu = new PopupMenu();
menuItems[SAVE] = addPopupItem(dataPopupMenu, "Save Data...");
menuItems[COPY] = addPopupItem(dataPopupMenu, "Copy 1st Data Set");
menuItems[COPY_ALL] = addPopupItem(dataPopupMenu, "Copy All Data");
dataPopupMenu.addSeparator();
menuItems[ADD_FROM_TABLE] = addPopupItem(dataPopupMenu, "Add from Table...");
menuItems[ADD_FROM_PLOT] = addPopupItem(dataPopupMenu, "Add from Plot...");
menuItems[ADD_FIT] = addPopupItem(dataPopupMenu, "Add Fit...");
return dataPopupMenu;
}
代码示例来源:origin: net.imagej/ij
void addPopupMenu() {
pm=new PopupMenu();
addPopupItem("Save As...");
pm.addSeparator();
addPopupItem("Cut");
addPopupItem("Copy");
addPopupItem("Clear");
addPopupItem("Select All");
add(pm);
}
内容来源于网络,如有侵权,请联系作者删除!