W
Will Barker
I am currently using the following to display a popup menu :
JPopupMenu popup;
..
..
popup = new JPopupMenu();
menuItem = new JMenuItem("test...");
menuItem.addMouseListener( new MyMouseListener() {
public void mouseReleased(MouseEvent m) {
} // MouseReleased
});
..
..
popup.add(menuItem);
..
..
popup.show(e.getComponent(),e.getX(),e.getY());
When the user then clicks on the test menuitem, mouseReleased gets called.
That's fine. But what if the user dismisses the menu e.g. by clicking
outside the area of popup. How do I get notification of that? Is there some
event I can look out for?
JPopupMenu popup;
..
..
popup = new JPopupMenu();
menuItem = new JMenuItem("test...");
menuItem.addMouseListener( new MyMouseListener() {
public void mouseReleased(MouseEvent m) {
} // MouseReleased
});
..
..
popup.add(menuItem);
..
..
popup.show(e.getComponent(),e.getX(),e.getY());
When the user then clicks on the test menuitem, mouseReleased gets called.
That's fine. But what if the user dismisses the menu e.g. by clicking
outside the area of popup. How do I get notification of that? Is there some
event I can look out for?