Skip to main content

Posts

Showing posts with the label jpopupmenu

Open popupMenu only on mouse-click Swing

I have a question related with JPopupMenu that maybe someone can help me. As far as I can see, a JPopupMenu opens when you press a JMenu (is this is in a JMenuBar) or when you hover over a JMenu (if this is in a JPopupMenu). So, I have a JMenuBar containing a JMenu (let's call it 'File'). When I press 'File', a JPopupMenu open, which contains a JMenuItem and another JMenu (let's call it 'Properties'). Is there any way I can apply the same behaviour to the Properties JMenu as I have in the File JMenu: only opens the JPopup when the user click it and not hover over it? I know this is trying to avoid the normal behavior for the JMenu, but any of you have an idea if this is possible?