List of usage examples for java.awt Component add
public void add(PopupMenu popup)
From source file:PopupDemo.java
void addPopup(Component c, String name) { PopupMenu pm = new PopupMenu(); MenuItem mi = new MenuItem(name + "-1"); mi.addActionListener(this); pm.add(mi);/* w w w . j av a 2 s . c om*/ mi = new MenuItem(name + "-2"); pm.add(mi); setHash(c, pm); c.add(pm); c.addMouseListener(this); }