posted 11 years ago
Create an Airline reservation program with fields for:
first name and last name, address, city, state and zip
flight number
date and time of flight
starting city and ending city
credit card number and type of card (MasterCard, Visa or Discover)
Use labels and textfields for name, address, city, state and zip
Use a label and combo box to select a list of flight numbers (include at least 5 flight numbers)
Use a label and list for a list of dates (include at least 5 dates)
Use a label and slider to select at least 5 different flight times
There should be at least 3 buttons on form
a submit button - when the user clicks submit, a new window should pop up using a text area to display all information in a nicely formated form.
a clear button - use to clear all textfields and reset default values
an exit button - to close the program
The informational frame uses a text area to display all information and contains a close button to exit the frame and return to the main window when user is done viewing information.
The main class, Asg10
creates the ReservationFrame (or whatever you called your main frame class)
sets the title for the frame
sets the location of the frame
assigns a default close operation
sets visible to true
I suggest using one panel for textfields, another panel for combo box, list and slider, and a final panel for the three buttons. You will need to select the the best layout for each panel to make objects display as you like. Add those to the main frame using more than likely a BorderLayout.
Suggestion: You can use more panels to improve layout and place panels within other panels before adding to main frame. For example, if you have six JTextFields for first name, last name, address, city, state and zip, you could use three panels all with FlowLayout set to left. Add the first name label, first name textfield, last name label and last name textfield to the first FlowLayout panel, the address label and address textfield to the second FlowLayout panel, and add the labels and textfields for city state and zip to the third FlowLayout panel. Then, add all three panels to a grid layout panel using 3 rows and 1 column. So be creative, the sky is the limit.