

Adding Guests to the Guest List
Now, when the user submits the form, you'll add the information to the allGuests array rather than displaying it directly.- Switch to the code for Main.java.
- In the submit method, add the following code before the return statement:
((Application)application()).addGuest(currentGuest); currentGuest = new Guest();
This code calls the application's addGuest method, which adds an object (in this case, currentGuest) to the end of the array. Then it creates a new Guest object to hold the next guest's data.
Table of Contents
Next Section