Java Reference
In-Depth Information
a) Initial
Address Book
screen.
b) Results of clicking
Browse All Entries
.
c) Browsing to the next entry.
d) Finding entries with the last name
Green
.
e) After adding a new entry and browsing to it.
Fig. 24.32
|
A simple address book. (Part 8 of 8.)
To add a new entry into the
AddressBook
database, the user can enter the first name,
last name, email and phone number (the
AddressID
will
autoincrement
) in the
JTextField
s
and press the
Insert New Entry
JButton
. The
insertButtonActionPerformed
handler (lines
338-352) is called. Lines 340-342 call the method
addPerson
on the
PersonQueries
object
to add a new entry to the database. Line 351 calls
browseButtonActionPerformed
to obtain
the updated set of people in the address book and update the GUI accordingly.