Hi. I need help with a mouse listener on a menu I made. I added a mouse listener to the each Menu item. If a user left clicks the menu item, it opens the option. But if he right clicks on the menu item, it should keep the menu open and display the right click popup menu. I got the popup menu to display on right click, but the menu closes, so the user cannot see which item he right clicked on.
Is it possible to override the default close operation of Jenu and keep the menu open until I left click on the menu item?
e.consume() does not seem to work on JMenuItems. It only seems to work on buttons. If I put an operation and e.consume() in one of the MouseListener methods, it seems to ignore e.consume(), executes the operation and closes the menu.