build a GUI that allows a store clerk to enter a pizza order. You should be able to create a PizzaOrder object once all data has been entered into the UI. 
The UI works as follows:
1. When a customer calls up to order a pizza, they provide their phone number which is entered into the phone number text box. When a newline (return) character is entered in the phone number text box, a list of Customers should be searched for a matching phone
number. The matching customer’s name should be placed in the name text box.
2. If the customer cannot be found, pop up a dialog box with an appropriate message. This UI does not allow new customers to be entered – that would be a different UI which we will not implement. Thus this UI only supports existing customers we have in our database.
3. The remaining data – size, pickup or delivery, and toppings can be entered
4. The Total button should calculate the cost of the pizza and put the cost in the cost text box 
5. The Enter button should extract the data from the UI and instantiate a PizzaOrder object that represents the order. The PizzaOrder object should then be printed.
For your solution, you should use at least two different layout managers. Two of the text fields should not be editable the customer name (which will be looked up when given a phone number), and the cost of the pizza (which should be calculated from the other data entered).
Break your GUI into multiple JPanel classes. This allows you to instantiate one of your panels and add it to a JFrame to test it. Once you have all the panels working, you can combine them together to create a more complex UI.
文章標籤

archerdevil 發表在 痞客邦 留言(0) 人氣(577)