A JFramein (From Swing) allows you to set the menu bar (Instance MenuBarwith JFrame.setMenuBar(mb);). This menu bar may appear in different places depending on the system in which it is running. If the operating system in which the application is running has a menu bar at the top of the screen, this menu bar set to JFrameusually appears in this menu bar. If this is not supported, the menu bar will be displayed at the top of the frame itself.
In the example below you can see different types of behavior in different systems:


This is an example of the code that I use to customize the menu bar:
MenuBar mb = new MenuBar();
Menu m = new Menu("Menu 1");
MenuItem mi1 = new MenuItem("Menu Item 1");
MenuItem mi2 = new MenuItem("Menu Item 2");
MenuItem mi3 = new MenuItem("Menu Item 3");
m.add(mi1);
m.add(mi2);
m.addSeparator();
m.add(mi3);
mb.add(m);
setMenuBar(mb);
: , ( )? , .
, , , , ?