Second edit: This prevents the popup from closing if you click elsewhere in the JFrame (or more correctly, its content pane). Clicking a menu item hides the popup; if that too is undesired, see my blog post
Keeping Menus Open.
I don't think there's any reasonable, LaF independent way to keep the popup open if the mouse is clicked outside the
Java application or if the window is resized or minimized.
If you opt for this solution, you may need to iterate recursively over all components and set the client property.