If I run the following application and then right-click on the
application, a popup menu will show up. If I move mouse outside the frame (I try to make JComponent visible so that I can move mouse outside JComponent, but I cannot make it happen), popup menu is still visible. I try to add the following to mouseExited method:
or add the following to let popup listen to mouse listener:
But these seemingly will disable pupup menu.
What I try to do is: make popup disappear once user move her mouse outside frame (better yet JComponent). How can I do this?
Here is the sample code I just created: