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

ListTest

Prerequisites

In this exercise, you will write an applet that creates and displays a List component.

Perform the following tasks:

  1. Create an applet called ListTest. Define an array of strings, called items, containing strings you want displayed in a List. Add a new instance of MyList (with arguments "5,items").
  2. Define the class MyList, as a subclass of List accepting the number of items to display and a list of String objects as the elements of the List.
The task numbers above are linked to the step-by-step help page. Also available is a complete solution that meets these requirements.

Related Exercises