|
Training Index
by
Help
API Docs
About This Short Course
Short Course
Exercises
Create an applet RadioButtons with two radio buttons that allow a user to choose between two opinions of the Java programming language.
Skeleton Code
Tasks
|
1.
|
Create a Panel instance and add three components to it:
- The label "Java is:"
- A checkbox labeled "Powerful"
- A checkbox labeled "Elegant"
The two Checkbox objects should be under the control of a CheckboxGroup object.
Add the panel to the applet.
|
|
2.
|
Register and listen for events in the RadioButtons applet in order to display the label of the activated checkbox in the TextField object (already provided). (RadioButtons should implement the ItemListener interface.)
|
Where help exists, the task numbers above are linked to the
step-by-step help page.
Solution Source
Demonstration
This exercise only runs within browsers that support the Java Runtime Environment 1.1 and appletviewer. If you are using an appropriate browser, try this exercise. The output should look similar to the following:
Copyright 1996-2000 jGuru.com. All Rights Reserved.
|