lathomas64
lathomas64

Reputation: 1642

Set JMenuBar position below JPanel

I am working with a JDialog that is setUndecorated(true) and has a JPanel included to replace the default title bar. Currently there is an internal frame inside the JDialog which has among other things a JMenuBar attached to it.

I would like to move the JMenuBar to the JDialog but have it displayed below the JPanel. How can I have a JMenuBar which is added to a JDialog appear below a JPanel which is added to the same JDialog.

Upvotes: 0

Views: 1706

Answers (1)

camickr
camickr

Reputation: 324108

Make sure your panel uses a BorderLayout. Then you can use:

panel.add(menuBar, BorderLayout.South);

Upvotes: 4

Related Questions