Technical Support
Discussion Forum
Online Training
Read About Java
Java In-Depth
Product Discounts
Membership Information

Java Cup Logo

JDC Home Page


Working Applet
Help and Hints
Source Code
Table of Contents
Online Training
shadowSearchFAQFeedback

CheckboxTest

Prerequisites

  • None.
In this exercise, you will write an applet that creates and displays a Checkbox.

Perform the following tasks:

  1. Create an applet called CheckboxTest. Create and add a new instance of a class you will create called MyCheckbox.
  2. 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."
  3. 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