-
Notifications
You must be signed in to change notification settings - Fork 2
Description
All modules function as intended. The purpose of this project is to create a GUI application that implements an AddressApplication of project 1. The GUI contains a scrollable area, display button, new button, remove button, and find button.
- Display button: Updates the entries and clears any JList selection.
- New button: Allows you to add a new entry.
- Remove button: Allows you to remove an entry.
- Find button: Allows you to find an entry by the last name.
- Entries are read from a database and if an entry is added or removed the database is updated.
Runtime complexity for loading, addition, removal, find, listing, saving. Use O(n) where n is the number of entries: loading from database O(n^2), addition is O(n), removal O(n), find O(n), listing O(n), saving O(n). This application extends the previous project to create an address book with GUI. Address entries are initially read from a database using the function readDataBase, which takes in a String parameter fileName then loads the database into the address book. Users can add, remove, and find entries. Every contact has a first name, last name, street address, city, state, zip code, phone, and email. All classes are in the package address, which contains a GUI package and a data package. address.data contains the Name class, Address class, and AddressEntry class. Address.GUI contains the AddressBookAppSwing GUI class and the AddressEntry GUI class. AddressEntry contains all the information (first name, last name, street address, city, state, zip code, phone, and email) for an entry and their setters and getters. AddressBook creates an ArrayList called addressEntryList that stores new AddressEntry objects. Adding an entry to the end of a list has a running time of O(1). To sort the entries alphabetically by last name takes O(n). Find, remove, and list all are O(n) because they require iterating through addressEntryList. The database is read with the function readDataBase() which accesses the database and creates a new entry in the address book. addDataBase() takes in a AddressEntry object parameter and adds it to the database. RemoveDataBase() takes in an index and deletes the entry at the index from the database. The database functions require using SQL.
