JMenu to JPopupMenu
I want to make a JPopupMenu that appears at a left click. I already have a suitable JMenu in my JMenuBar, so I used the getPopupMenu method as follows:
So then when I left click, the new JPopupMenu appears with all the correct JMenuItems. But I can't click on any of them - I don't even get a response from hovering over them... If, however, I do the following, with everything else exactly the same:
JPopupMenu popup = myMenu.getPopupMenu();
//myMenu is my existing JMenu
It then works perfectly...
JPopupMenu popup = new JPopupMenu();
popup.add("A menu item");