Exercises

September 22 - September 25, 2006

  1. Experiment with class GUI
    1. Change the color of the panel
    2. Change the size of the panel
    3. See what happens if you do not “pack”
    4. See what happens if you do not make visible
    5. Add a second label of a different color
  2. Compile and run GUIWButton.
  3. Create a GUI with a label and text field. Allow the user to enter text in the text field. When the user presses enter, update the text of the label to be the text contained in the text field.
  4. Add a button to the program you wrote for exercise 3. When the user presses the button OR presses enter, update the text of the label to be the text contained in the text field.
  5. Modify your program from exercise 4 to keep a count of the number of times you have changed the label.

 


Sami Rollins