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

Solution

Download TextAreaTest source code.

HTML Interface to Applet


<APPLET CODEBASE="/applets/magelang/AWT-Training/classes/" CODE="TextAreaTest.class" WIDTH=300 HEIGHT=100 ALIGN=CENTER></APPLET>

Java Code


import java.awt.*;

public class TextAreaTest extends java.applet.Applet {
    TextArea disp;
    public void init() {
        disp = new TextArea("click outside TextArea", 5, 30);
        add(disp);
    }

    public boolean mouseDown(Event e, int x, int y) {
        disp.appendText("\npushed mouse...");
        return true;
    }
}