I am trying to undock a JPanel in a JFrame in such a way that i can move the JPanel seperated from the JFrame when it is undocked. The problem i'm encountering is that the JMenuBar that i'm using disappears when i focus on the undocked JPanel. I'm currently using a JDialog for undocking the JPanel. The disappearing of the JMenuBar is because of the JDialog, because when using mac osx, the JMenuBar on the top of the screen is not available for JDialogs.
Does anyone have any idea how the undocking can be done different (in such a way that i can keep the JMenuBar), or maybe even fixing the problem that i'm having?
Here are pictures to give the visual idea with the problem.
In the second picture, the JMenuBar in the top disappeared. I temporarily added the JMenuBar in the top of the JDialog, because otherwise i couldn't use the keyboard shortcuts anymore.
If there are any questions, dont hesitate to ask.
Thanks in advance