CheckboxTest
Prerequisites
In this exercise, you will write an applet that creates and displays
a Checkbox.
Perform the following tasks:
-
Create an applet called CheckboxTest. Create and add a new instance of a class you will create called MyCheckbox.
-
Create call MyCheckbox as a subclass of Checkbox. Make its constructor (which has no arguments) call the constructor of Checkbox with the label "Always Prompt."
-
Define the method action in MyCheckbox so that when the user clicks on the MyCheckbox the state is printed to System.out.
The task numbers above are linked to the
step-by-step help page. Also available
is a complete solution which meets
these requirements.
Related Exercises
|