1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive. 2. Create a new project named LabExer8. Set the project location to your own folder. 3. Construct import statements to use the packages listed below: • javax.swing • java.awt java.awt.event 4. Extend the JFrame class and implement the ActionListener interface. 5. Create a JMenuBar named mainBar and two (2) JMenu objects named menu1 and menu2. Set th text of menu1 as File and the text of menu2 as Event Type. 6. Create the items that will appear in the menus. The File menu shall contain an Exit submenu. Nam the object exit. The Event Types menu shall contain two (2) submenus: Adult and Child. Name th obieote adul ond obild apootively Th e AdulIt oub oneiet of: Dirthdey (ad.ultRde

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Procedure:
1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive.
2. Create a new project named LabExer8. Set the project location to your own folder.
3. Construct import statements to use the packages listed below:
• javax.swing
• java.awt
java.awt.event
4. Extend the JFrame class and implement the ActionListener interface.
5. Create a JMenuBar named mainBar and two (2) JMenu objects named menu1 and menu2. Set the
text of menu1 as File and the text of menu2 as Event Type.
6. Create the items that will appear in the menus. The File menu shall contain an Exit submenu. Name
the object exit. The Event Types menu shall contain two (2) submenus: Adult and Child. Name the
objects adult and child, respectively. The Adult submenu shall consist of: Birthday (adultBday),
Anniversary (anniv), Retirement (retirement), and Other (adultOther). The Child submenu shall
consist of Birthday (childBday), and Other (childOther).
7. Declare several other components that will be used in the program. Create two (2) JPanel objects
named currentPanel and otherPanel. Create two (2) JLabel objects named currentLabel and
otherLabel. The first JLabel has blank text while the second has: We have lots of ideas for
memorable events.
8. Write the constructor for the JFrame. Set the title as Party Planner. Set the default close operation
and create a FlowLayout object by typing new FlowWLayout() within the parentheses of the
setlayout () method.
9. Create three (3) methods. Name them composeMenus ( ), addActionListeners(), and
layoutComponents().
10. For the composeMenus() method, set the main menu bar, and add two (2) menus to it. Then add
one (1) option to the first menu and two (2) submenus to the second menu. Finally add four (4) items
to the first submenu and two (2) items to the other one.
11. For the addActionListeners () method, set all the submenu options as action listeners.
12. For the layoutComponents() method, add currentLabel to currentPanel then add otherLabel to
otherPanel. Add currentPanel and otherPanel to the JFrame.
13. Go back to the constructor and call the three (3) methods you have just created.
The initial output shall be:
Transcribed Image Text:Procedure: 1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive. 2. Create a new project named LabExer8. Set the project location to your own folder. 3. Construct import statements to use the packages listed below: • javax.swing • java.awt java.awt.event 4. Extend the JFrame class and implement the ActionListener interface. 5. Create a JMenuBar named mainBar and two (2) JMenu objects named menu1 and menu2. Set the text of menu1 as File and the text of menu2 as Event Type. 6. Create the items that will appear in the menus. The File menu shall contain an Exit submenu. Name the object exit. The Event Types menu shall contain two (2) submenus: Adult and Child. Name the objects adult and child, respectively. The Adult submenu shall consist of: Birthday (adultBday), Anniversary (anniv), Retirement (retirement), and Other (adultOther). The Child submenu shall consist of Birthday (childBday), and Other (childOther). 7. Declare several other components that will be used in the program. Create two (2) JPanel objects named currentPanel and otherPanel. Create two (2) JLabel objects named currentLabel and otherLabel. The first JLabel has blank text while the second has: We have lots of ideas for memorable events. 8. Write the constructor for the JFrame. Set the title as Party Planner. Set the default close operation and create a FlowLayout object by typing new FlowWLayout() within the parentheses of the setlayout () method. 9. Create three (3) methods. Name them composeMenus ( ), addActionListeners(), and layoutComponents(). 10. For the composeMenus() method, set the main menu bar, and add two (2) menus to it. Then add one (1) option to the first menu and two (2) submenus to the second menu. Finally add four (4) items to the first submenu and two (2) items to the other one. 11. For the addActionListeners () method, set all the submenu options as action listeners. 12. For the layoutComponents() method, add currentLabel to currentPanel then add otherLabel to otherPanel. Add currentPanel and otherPanel to the JFrame. 13. Go back to the constructor and call the three (3) methods you have just created. The initial output shall be:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education