Here you can find the source of createPopupMenu()
Create a JPopupMenu
instance.
public static JPopupMenu createPopupMenu()
//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; } }