Question: A class MyFrame creates the frame on the right side containing a pulldown menu with two menu items using its constructor. (a) Write the class

A class MyFrame creates the frame on the right side containing a pulldown menu with two menu items using its constructor.

(a) Write the class and the constructor to create the menu bar, the menu, and the menu items. Also write the statements to add the menu bar to the frame, add the menu to the menu bar and add the first menu item to the menu. Then add action listener for the first menu item. No import statements are needed.

(b)Write the actionPerformed(ActionEvent ae) method to display a message dialog box shown on the right side if the first menu item is chosen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!