public interface PopupMenuCustomizer
JPopupMenu
. The
customizePopup(JPopupMenu)
method will be called just prior to each showing of the
menu. Thus, the implementor should clear the menu at the beginning of the customization. Here is
a simple PopupMenuCustomizer
implementation:
public class MyPopupMenuCustomizer implements PopupMenuCustomizer { public void customizePopup(JPopupMenu popup) { popup.removeAll(); JMenuItem menuItem = new JMenuItem(menuString); menuItem.addActionListener(someActionListener); popup.add(menuItem); } }
Modifier and Type | Method and Description |
---|---|
void |
customizePopup(JPopupMenu popup)
Called just prior the given
JPopupMenu being shown. |
void customizePopup(JPopupMenu popup)
JPopupMenu
being shown.popup
- the JPopupMenu
about to be shown.