JamesMadisonUniversity

CS Dept


CS 159 Lab: Creating an application


Objectives:

Students will:
  • Create an application with a GUI front end.

New Terms:

 

Materials:

Acknowledgment:

Gaddis, Chapter 12, Programming Challenge #6.

Introduction:

Implement Programming Challenge #6 in Chapter 12 on page 841 of Gaddis (5E). The application handles billing for services at Joe's Automotive. The application must be able to handle charges for some routine maintenance services. It also must have the ability to put in miscellaneous charges for parts and a separate place for labor hours. Your application will make it easier for the staff at Joe's to calculate a customer total for all of the services that they have received.

Part 1 - Getting ready and exploring the existing code.

  1. First, draw out (on paper or whiteboard) what you want your application to look like. What will make it easy to use? Consider elements such as check boxes (12.4) or radio buttons (12.4) to make selecting standard services easier.
  2. Consider the different kinds of layout managers that could help you to make the application look nice. Would a Border_Layout object allow you to position elements correctly, or is a Grid_Layout better?
  3. Consider how a user will signal the application that they are done entering and ready to have the application calculate the price. Where will you display the price?

Part 2 - Creating the application.

  1. Begin by creating the overall class, JoeAutomotive extending JFrame. Use examples from the book if you need some help getting started.
  2. Add your major components to the JoeAutomotive class attributes. Decide if you want to instantiate them in the Constructor or build individual methods (like in the menu lab).
  3. Add your "enter" button or other signal and add the ActionListener to perform the calculations.

Turning in your work

  1. For Prof Nancy Harris, Sections 1, 4, 5: Demonstrate your working program in lab.
  2. For Prof Arch Harris, Sections 2, 3, Demonstrate your working program in lab.

 


Updated 04/22/2014 (nlh)