Exercises for Chapter 1

1.1 Redesign the final STD so that pressing the increment button when the counter is displaying its maximum value will cause it to display its minimum value and likewise pressing the decrement button at the minimum value will result in the maximum. Hint: what will this change do to the number of states?

1.2 Implement the design from exercise 1.1.

1.3 How can the ClickCounter applet, as developed in the chapter, be shown to be correct? Hint: you do not want to have to press the increment button one thousand times.

1.4 How could you determine which of the three possible implementations: that presented in the chapter, that developed in Exercise 1.3 and that suggested in Figure 1.4, would present the least number of usability problems to a user?

1.5 A VehicleCounter application is required. In this application two click counter instances are required, one to be used to count cars as they pass the counter and one to count all other vehicles. A third numeric display is to provided which will show the total of the two counters. Produce a state transition diagram for this application and implement the resulting design.

1.6 Design and implement an application which will either display the date or the time. The application class should provide dateIs() and timeIs() methods and this can be simulated for this exercise by returning constant strings. The interface should present a display area at the top and two buttons, a date button and a time button, at the bottom. The date button should be insensitive when the time is displayed and vice versa; pressing a button should have the expected effect.


Table of Contents.

Summary of Chapter 1




A Java GUI programmer's primer
Java GUI Programmers Primer, A
ISBN: 0139088490
EAN: 2147483647
Year: 1998
Pages: 85
Authors: Fintan Culwin

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net