You should have created the MainMenu
frame as part of the project task from last week's lab. If you have not yet created this frame, then do so now.
There are two things that need to happen for the MainMenu
to be useful:
The Main
class that you created in the last lab should create and display an instance of the MainMenu
frame.
Refer to the reference section for information on how to do this (Swing/Displaying Frames)
The button handlers for the buttons on the main menu should perform the appropriate actions:
The <
> button should callSystem.exit(0)
to exit the system. The 0 is an exit code that usually implies that the program exited normally. Numbers greater than 0 imply that the program exited due to an error. The other buttons should display the appropriate dialog. We only have the ProductEditor
dialog to link at this point --- the next section will show you how to do this.
Test the system by running the Main
class. You should see the MainMenu
appear. The <
Now would be a good time to commit. Remember to reference the issue that relates to creating the Main Menu in your commit message.