Java JMenuBar, JMenu and JMenuItemThe JMenuBar class is used to display menubar on the window or frame. It may have several menus. The object of JMenu class is a pull down menu component which is displayed from the menu bar. It inherits the JMenuItem class. The object of JMenuItem class adds a simple labeled menu item. The items used in a menu must belong to the JMenuItem or any of its subclass. JMenuBar class declarationJMenu class declarationJMenuItem class declarationJava JMenuItem and JMenu ExampleOutput: ![]() Example of creating Edit menu for Notepad:Output: ![]()
Next TopicJava JPopupMenu
|