Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public ctans Memofiarfxample extends Application I puble void stactistage primarystagel I Frrote an oblect of Mlenubir MenuBar menubar - new Menuearo. Arrate objects of Menu

image text in transcribed
public ctans Memofiarfxample extends Application I puble void stactistage primarystagel I Frrote an oblect of Mlenubir MenuBar menubar - new Menuearo. Arrate objects of Menu Menu file o new Menu(Eile') Meru edit = new Menu("Edit") A Map the neenu objects to the menu bar menubargetMenusd.addifile: menubar getMenus0.add(edit): ECreofe a loyout arid add the menu bar to it BorderPane root = new BorderPaneD; root.setTop(menubar): root-setstyle("-fx-background-color; BElGE"): - Create menu items Menultem open = new Menultem("Open"); Menultem exit = new Menultem(-Exit"): BMap the menu items to the Menu "File". file.getitems[).addiopen): file.getitems()add(exit): This is good too: filegetltems(l.addAll(open, exit) WAdd this layout to a scene Scene scene a new Scene(root)i grimarystage.setscene(scene); primarystage.setWidth(400): primarystage.setHeight(400): primaryStageserTitel Menu Bar Example")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions