Package com.explodingpixels.widgets
Interface PopupMenuCustomizer
- All Known Implementing Classes:
PopupMenuCustomizerUsingStrings
public interface PopupMenuCustomizer
An interface that is used to popuplate a
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);
}
}
-
Method Summary
Modifier and TypeMethodDescriptionvoidcustomizePopup(JPopupMenu popup) Called just prior the givenJPopupMenubeing shown.
-
Method Details
-
customizePopup
Called just prior the givenJPopupMenubeing shown.- Parameters:
popup- theJPopupMenuabout to be shown.
-