Java JPopupMenu createPopupMenu()

Here you can find the source of createPopupMenu()

Description

Create a JPopupMenu instance.

License

Open Source License

Return

a JPopupMenu instance

Declaration

public static JPopupMenu createPopupMenu() 

Method Source Code

//package com.java2s;
import javax.swing.JLabel;
import javax.swing.JPopupMenu;

public class Main {
    /**//from w  w w.ja  va  2 s .c  om
     * <p>
     * Create a <code>JPopupMenu</code> instance.
     * </p>
     *
     * @return a JPopupMenu instance
     */
    public static JPopupMenu createPopupMenu() {
        JPopupMenu popupMenu = new JPopupMenu();
        popupMenu.add(new JLabel("Help"));
        popupMenu.addSeparator();
        popupMenu.add(new JLabel("About"));
        return popupMenu;
    }
}

Related

  1. addSeparatorIfNeeded(JPopupMenu popupMenu)
  2. applyDefaultProperties(final JPopupMenu comp)
  3. attachPopupMenu(final JComponent component, final JPopupMenu popupMenu)
  4. cleanPopupLayoutMetrics(JPopupMenu popupMenu)
  5. computePopupLocation(MouseEvent event, Component rel, JPopupMenu popup)
  6. createPopupMenu(String menuText, JPopupMenu menu, ActionListener listener)
  7. ensurePopupIsOnScreen(JPopupMenu popup)
  8. findMenuComponent(JPopupMenu menu, String menuComponentName)
  9. findSubMenu(JPopupMenu popupMenu, String name)