Presentation is loading. Please wait.

Presentation is loading. Please wait.

GUI Applications JCheckBox

Similar presentations


Presentation on theme: "GUI Applications JCheckBox"— Presentation transcript:

1 GUI Applications JCheckBox

2 Contents Problem: An Order Calculator for the Brandi’s Bagel House
Solution Exercise: Implementing a Separate Model

3 A. Problem: An Order Calculator for the Brandi’s Bagel House
Brandi’s Bagel House has a bagel and coffee delivery service for the businesses in her neighborhood Customers may call in and order white and whole wheat bagels with a variety of toppings In addition, customers may order three different types of coffee (Delivery for coffee alone is not available, however)

4 Here is a complete price list
Bagels White bagel $1.25 Whole wheat bagel $1.50 Toppings Cream cheese $0.50 Butter $0.25 Peach jelly $0.75 Blueberry jam $0.75 Coffee Regular coffee $1.25 Decaf coffee $1.25

5 Brandi, the owner, needs an “order calculator” application that her staff can use to calculate the price of an order as it is called in The application should display the subtotal, the amount of a 6% sales tax, and the total of the order

6

7 B. Solution Developing the View Implementing Event Handlers
3.1. Implementing an event handler for the Exit button 3.2. Implementing an event handler for the Calculate button

8 2. Developing the View Project name: OrderCalculator
Class name: OrderCalculatorView Package: ordercalculator Frame title: Order Calculator

9 The Food and Drink Panel
The Title Label The Food and Drink Panel The Bagel Panel 1 Button Group The White Radio Button The Whole wheat Radio Button The Toppings Panel 4 Check Boxes The Coffee Panel 4 Radio Buttons The Button Panel 2 Buttons

10

11 3.1. Implementing an event handler for the Exit button
This is an exercise for you

12 3.2. Implementing an event handler for the Calculate button
Declaring the priceList map and implementing initPriceList() Implementing getSubtotal() Implementing the event handler

13 3.2.1. Declaring the priceList map and implementing initPriceList()

14 3.2.2. Implementing getSubtotal()

15 3.2.3. Implementing the event handler

16 Exercise Modify the application so that it has a separate Model class

17 Solution The Design The View & Controller The Model
The Data Transfer Object

18 1. The Design

19 2. The View & Controller

20 3. The Model

21 4. The Data Transfer Object

22 References GUI Building in NetBeans IDE Starting Out With Java 5 from control structures to objects. Tony Gaddis


Download ppt "GUI Applications JCheckBox"

Similar presentations


Ads by Google