Question: 9. Use GridBaglayout and any other layout managers, as required, to code the window shown in Figure 16.20 to simulate customer payments. Your code must


9. Use GridBaglayout and any other layout managers, as required, to code the window shown in Figure 16.20 to simulate customer payments. Your code must contain all required event handling. If a customer selects credit card payment, the display will show a list of acceptable credit cards. A text field for entering a valid credit card number must be provided. Pull down lists, as shown in the figure, for setting the credit card expiration date are required. After the user presses the Accept button, the program will use method JOptionPane.showMessageDialog() to display the entered information. If the user opts to pay using cash, the program will display the associated cash payment information after the Accept button is clicked. Write the driver code to test your modified code. Save all files. Payment Application X -Billing: Credit card Bill customer Visa Card type: Master Card American Express Card number: Expiration date: January 2005 Verified Accept Exit Figure 16.20 GUI layout for Exercise 9 9. Use GridBaglayout and any other layout managers, as required, to code the window shown in Figure 16.20 to simulate customer payments. Your code must contain all required event handling. If a customer selects credit card payment, the display will show a list of acceptable credit cards. A text field for entering a valid credit card number must be provided. Pull down lists, as shown in the figure, for setting the credit card expiration date are required. After the user presses the Accept button, the program will use method JOptionPane.showMessageDialog() to display the entered information. If the user opts to pay using cash, the program will display the associated cash payment information after the Accept button is clicked. Write the driver code to test your modified code. Save all files. Payment Application X -Billing: Credit card Bill customer Visa Card type: Master Card American Express Card number: Expiration date: January 2005 Verified Accept Exit Figure 16.20 GUI layout for Exercise 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
