I'm trying to build a particular JMenu
.
I want a JMenuItem
with JMenu
functionality, I.E. when we click it the item should do something (like opening a dialog). But the JMenuItem
should also contain a button (or other component) that when we click it, should open a popup with a couple of options.
So, till now I have something like this:
That is what I have before click the arrow.
My problem is that, when I press the button (arrow), the sub-menu is actually opened, but the menu item that contains that button closes because loses focus.
That is the result after clicking in the arrow button.
Is there any way to manage this? Or a better way to have this behavior?