PopupMenuListener l= new PopupMenuListener() {
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
PopupMenuListener[] ls = datePicker.getPopupMenuListeners();
PopupMenuEvent retargeted = null;
for (PopupMenuListener listener : ls) {
if (retargeted == null) {
retargeted = new PopupMenuEvent(datePicker);
}
listener.popupMenuCanceled(retargeted);
}
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
PopupMenuListener[] ls = datePicker.getPopupMenuListeners();
PopupMenuEvent retargeted = null;
for (PopupMenuListener listener : ls) {
if (retargeted == null) {
retargeted = new PopupMenuEvent(datePicker);
}
listener.popupMenuWillBecomeInvisible(retargeted);
}
}
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
PopupMenuListener[] ls = datePicker.getPopupMenuListeners();
PopupMenuEvent retargeted = null;
for (PopupMenuListener listener : ls) {
if (retargeted == null) {
retargeted = new PopupMenuEvent(datePicker);
}
listener.popupMenuWillBecomeVisible(retargeted);
}
}