created 01/08/02

Chapter 58 Programming Exercises

Exercise 1 -- Toggle Color Button

Modify the ButtonDemo program so that it changes the color of the frame for every click of the button. Change the color back and forth from red and blue. Start the frame out with a blue background.

Click here to go back to the main menu.


Exercise 2 --- Click Counter

Modify the ButtonDemo program so that the text on the button shows how many times the button has been clicked. Use the method setText(String text) to change the button's text.

Click here to go back to the main menu.