labs / tiddlers / content / labs / lab03 / _Labs_03_Displaying the Main
@Mark George Mark George on 20 Jul 2021 1 KB WIP lab 3

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:

  1. 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)

  2. The button handlers for the buttons on the main menu should perform the appropriate actions:

    The <

    > button should call System.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 <

> button should quit the application.

Now would be a good time to commit. Remember to reference the issue that relates to creating the Main Menu in your commit message.