Introduction
JavaFX is a handy tool if you are interested in creating rich web applications or need to deliver desktop applications. In simple words, JavaFX is a set of graphics and media packages enabling developers to design, create, test, debug, and deploy rich web and desktop applications that operate consistently across diverse platforms. If you are not familiar with JavaFX, don't worry! We've got you covered. Check out JavaFX on coding ninjas and then carry on forward in this article.
Here we will introduce the core concept, usage, and implementation of the JavaFX Menu with the help of an example.
So without further ado, let’s get going!

JavaFX Menu
The menu is a vital component of any application, Duh! We need to select stuff. JavaFX provides us with a Menu class that implements menus. The javafx.scene.control.Menu class represents a menu in JavaFX, and instantiating this class will create a menu for you.
Menu MenuName = new Menu("Menu Name"); //creates Menu
You must be wondering, what about the menu elements, the title, the bar, and the items. So while you instantiate this class, you can pass the menu title as a parameter to its constructor. The Menu class also contains an observable list holding the menu item, i.e., the menu's contents.

The javafx.scene.control.MenuItem class, a superclass of the mentioned Menu class, represents the menu items. You can display text or graphics as menu items and add the desired cation to them.
MenuItem MenuItem1 = new MenuItem("Menu Item 1 "); //creates Menu Item
MenuName.getItems().add(MenuItem1); //adds Menu Item to the Menu
Whereas, the javafx.scene.control.MenuBar class represents a menu bar holding all the menus in a UI application.
ManuBar menubar = new MenuBar(); //creates MenuBar
menubar.getMenus().add(MenuName); //adds Menu to the Menu Bar






