How do I attach a JMenuBar to the top of the JFrame? [closed]

-2

I forgot how to do this, I remember that I have to put a BorderLayout(... NORTH); . How do I put JMenuBar in JFrame ?

    
asked by anonymous 13.05.2017 / 22:26

1 answer

0

You do not add a menu bar as any component, the way to add it is:

seuJFrame.setJMenuBar(seuJMenuBar);

If you want more details, here are some links from the documentation explaining:

How to Use Menus

How to Make Frames (Main Windows)

    
13.05.2017 / 22:52