CS3340:  Intro OOP and Design

Exercise -GUI
due: Nov. 1

 

Extend your PROJECT 1 so that it now becomes a GUI application as required in Project 2. For this exercise it should still upon starting create an instance of the AddressBook class and also load contacts from a file into the collection of AddressEntries stored in AddressBook. However, now upon starting up it should present the user with a GUI that has multiple Buttons and a scrollable frame:

1) "Display" button - this button when hit would display the current collection of AddressEntriy objects (using toString()) in the scrollable window. The AddressEntries should be in alphabetical order by last name.

2) "New" button - this button when hit would display a dialog box for entering information in for a new AddressEntry

3) "Remove" button - Somehow you need to select an AddressEntry before this button is enabled and then this button will remove it from the collections in AddressBook and update the display as appropriate. Please note, I am not telling you how to select an AddressEntry....this is up to you to decide how to do. TIP: try to do it in a way that is most compatible with Project 2.

3) Scrollable frame (or similar) - this is where users can view the current address list.

 

NOTE: The program does not respond when the buttons are hit (NO event handling) and hence there is no list of buttons displayed. ALSO, the new button does not pop-up the dialog box. This will be our next exercise.

p.s. this exercise will help you with your Project 2. You may want to look at the project description before starting.

Deliverables

Demonstrate to fellow class mate and sign the sheet ---if you did not succeed this is your SAFTEY check to get help from instructor or make appointment if no time in class if you could not complete --you WILL be required to do this for your project. Note: I won't give you points back --ideally you come and see for help before the exercise is due.

 

© Lynne Grewe