Day 4 Lab Exercises
July 9, 1997






  1. (a) Make the thermometer canvas changeable by adding an event handler that takes any click on the canvas between the minimum and maximum temperatures and resets the thermometer to the temperature of the x value where the click occurred.

    (b) Now write a driver that displays multiple thermometers in a frame. Use the changeable feature of each thermometer to set each thermometer to a different temperature. The directory for the source code of the simple thermometer and the output produced by that program.

  2. Use the Grid layout manager to lay out a 2x3 grid of buttons. Use some long and short labels for the buttons. How does this affect the size of the buttons in the grid?