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

TextAreaTest

Prerequisites

  • None.
In this exercise, you will write an applet that displays a TextArea component. A TextArea is a text type-in box which can hold multiple lines of text of any width. The TextArea can scroll horizontally and vertically to view text outside of its display region.

Perform the following tasks:

  1. Create an applet called TextAreaTest. In the init method, create a new instance of the TextArea class, store it as an instance variable, and add it to the applet.
  2. Define the method mouseDown so that when the user clicks outside the TextArea "\npushed mouse..." gets appended to the TextArea.
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