CSc 221 Spring 2007 Homework 6
Homework 6 is a continuation and expansion of HW5. You will work in the same
teams, and the competed code is due on
Tuesday April 24, which is also the date of the
second midterm. (But the second midterm will have a concentration on HW5
and HW6, so doing HW6 is good preparation for the midterm.)
You are asked to use whatever layout manager techniques that are useful and
appropriate, to put four temperature displays in one frame. The displays are:
- A simple display and text entry field, with the temperature in degrees
Fahrenheit.
- A simple display and text entry field, with the temperature in degrees
Celsius.
- A slider for setting the temperature, in degrees Celsius.
- Your fancy display, whatever it is. You are free to jazz it up, if you
see fun things to do and have time, but you are not required to do so and
there is no extra credit if you do.
You may well have GUI components within GUI components, and you may invoke
more than one kind of display manager. The requirements of this aspect the the
HW are:
- The outer containing frame must be resizable, but if you wish you could
establish a minimum size.
- The four displays must not change their positions in relation to each
other, as the user resizes the frame.
- The outer containing frame should be the only thing the user can resize.
She can't resize the slider, for example.
You are also to implement a small amount of exception handling. (Included by
popular request; many students asked to get some experience with exception
handling, which I am happy to do. It's an important subject, which is real life
can be a major part of some apps.) In particular:
- Put exception handlers on the text entry fields, to catch wrong format.
Look up the API. I intend only that you reject--with a diplomatic
message--any input except digits, the decimal point, and the minus sign.
- That's all I can think of at the moment. You could reject temperatures
below absolute zero, but that would be regular code, not an exception
handler. I think. If you see some chance to put in a different kind of
exception, feel free.
That's it. Not actually very big, but I'm giving you only a week.
Back to the top of the Spring 2007 CSc 221 page
Back to Dan McCracken's Home Page