Answer – setJMenuBar Method
Explanation – A menu can be regarded as the set of options which has been presented to the user of a computer application. It can especially help to locate information or execute a program function by the user and it is attached to windows. However, do you know how menus are actually attached to windows?
There’s a method for it! It’s called the setJMenuBar method. By calling this method, menus can be attached to windows in an efficient way. Therefore, the next time you see a menu, remember that it is most likely attached to the window by the setJMenuBar method!