1

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.

enter image description here

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. enter image description here

If there are any questions, dont hesitate to ask.

Thanks in advance

Triplle
  • 99
  • 1
  • 6
  • Consider `JToolBar`, seen [here](http://stackoverflow.com/a/4039359/230513) and [here](http://stackoverflow.com/a/10374442/230513) and [here](http://stackoverflow.com/a/11944233/230513). – trashgod Nov 10 '12 at 10:33
  • With some customization, JToolBar is perfect for the job. Thank you very much. For the record, i also quitted the project because of such stupid mistakes ;) @trashgod – Triplle Nov 10 '12 at 17:43
  • Guess what happens when i drag the JToolBar out of the JFrame... The JMenuBar disappears again.. So my problem is not solved. Do u have any idea why the JMenuBar disappears? Because i have no clue... – Triplle Nov 10 '12 at 17:50
  • I'm embarrassed... Simply using JFrame instead of JDialog solved the problem..... finally – Triplle Nov 10 '12 at 18:46

0 Answers0