I am very new to Java programming, and for a course in Uni, I'm required to write a program that acts as a Flight reservation system for an airline. The first version of the program was just through console outputs, so I didn't have many problems there. But now, the current stage of the project requires the implementation of a GUI, some of the functions of this GUI are to add a new passenger, display the list of passengers per flight, edit a passenger's info, or search for a specific passenger.
This means that I will need to create a new instance of the object Passenger for every passenger I add through the GUI. But I have no idea how to do this during runtime, how would I add new variables on a button click? I was thinking about using something like an array or a list, but then, how would I store/access the information each passenger has? Like the name, age, seat number and such?
What is a topic I could research to learn how to do this?
No responses yet.