Java 8 PopupMenu - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 PopupMenu class.

This code example shows how to use the following methods:add
	 
	// constructor 
	StaveActionHandler(Stave stave) {
		theApp = stave;
		 
        noteContextMenu = new PopupMenu();
         
        editNote = new MenuItem("Edit Note");
        editNote.addActionListener(this);
        noteContextMenu.add(editNote );       
         
        repeatNote = new MenuItem("Repeat Note");
        repeatNote.addActionListener(this);
        noteContextMenu.add(repeatNote ); 		
         
        makeRest = new MenuItem("Change to Rest");
        makeRest.addActionListener(this);
        noteContextMenu.add(makeRest);       
         
        deleteNote = new MenuItem("Delete Note");

5
CodeRank
This code example shows how to use the following methods:
                Menu m = new Menu("Menu " + (menuList.size() + 1));
                menuList.add(m);
                mb.add(m);
            } 
        }); 
        final PopupMenu popup = new PopupMenu("Popup");
        f.add(popup);
        f.addMouseListener(new MouseAdapter() {
            public void mousePressed(MouseEvent event) {
                if (event.isPopupTrigger()) {
                    popup.show(f, event.getX(), event.getY());
                } 
            } 
        }); 
        f.add(addMenu, BorderLayout.NORTH);
        Button addItem = new Button("Add item");
        addItem.addActionListener(new ActionListener() {
            int cnt = 1;
 
            public void actionPerformed(ActionEvent event) {

4
CodeRank
This code example shows how to use the following methods:add
	public JMenuBar getMenuBar() {
		return menuBar;
	} 
 
	public PopupMenu getTrayIconPopupMenu(ActionListener actionListenr) {
		PopupMenu popup = new PopupMenu();
		trayIconMenuItemExit = new MenuItem("Exit");
		trayIconMenuItemExit.addActionListener(actionListenr);
		popup.add(trayIconMenuItemExit);
 
		return popup;
	} 
 
	/** 
	 * Enable/Disable all menu bar items based on Runner view. 
	 *  
	 * @param mode 
	 */ 
	public void setView(int view) {
 
4
CodeRank
This code example shows how to use the following methods:add
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			} 
		}); 
 
		PopupMenu popupMenu = new PopupMenu();
		popupMenu.add(quitMenuItem);
 
		URL imageUrl = this.getClass().getClassLoader().getResource("images/icon.png");
		TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().createImage(imageUrl));
		trayIcon.setImageAutoSize(true);
		trayIcon.setToolTip("WebSocketRemote");
		trayIcon.setPopupMenu(popupMenu);
 
		SystemTray systemTray = java.awt.SystemTray.getSystemTray();
		systemTray.add(trayIcon);
 
		Server server = new Server(40320);
 
		ResourceHandler resourceHandler = new ResourceHandler();
4
CodeRank
This code example shows how to use the following methods:remove
      mediaPlayerControlsVisible = true;
    } 
  } 
   
  public void removeMediaPlayerControls(){ 
    popupMenu.remove(0);
    popupMenu.remove(0);
    popupMenu.remove(0);
    mediaPlayerControlsVisible = false;
  } 
 
 
} 
3
CodeRank
This code example shows how to use the following methods:remove
      mediaPlayerControlsVisible = true;
    } 
  } 
   
  public void removeMediaPlayerControls(){ 
    popupMenu.remove(0);
    popupMenu.remove(0);
    popupMenu.remove(0);
    mediaPlayerControlsVisible = false;
  } 
 
 
} 
4
CodeRank
See Code Examples for Java 8 PopupMenu Methods: