I have successfully added a right click pop up menu to my swing application. However, when I click near the bounds of the Window it will overlap onto underlying applications. How do I get it so the pop up menu stays with the bounds of the Window
Asked
Active
Viewed 443 times
1
-
have to override its bounds, but JPopup is displayed under coordinates, Point from mouse_event, then why to confuse a user – mKorbel Apr 03 '13 at 10:47
-
Popup menus usually work that way (at least on windows). Is there a particular reason you want the menu to stay within the window? What happens if the menu is not small enough in dimensions to fit the window? Maybe `setPopupSize` and `setLocation` could help. – frozenkoi Apr 03 '13 at 10:48
-
Answer here http://stackoverflow.com/questions/766956/how-do-i-create-a-right-click-context-menu-in-java-swing/767254#answer-766965 might help you also. – frozenkoi Apr 03 '13 at 10:56