top examplets

Empty Applet

Here's an empty, do-nothing applet. In real life, you'd override some of Applet's methods, such as init() and paint.


EmptyApplet.java

// EmptyApplet.java

import java.applet.Applet;

// A do-nothing applet.

public class EmptyApplet extends Applet
  {}

EmptyApplet.html

<APPLET code=EmptyApplet.class width=300 height=100>
</APPLET>

To compile this applet using the Sun JDK, enter this command:

     javac EmptyApplet.java

To run it, enter this command:

     appletviewer EmptyApplet.html

See also


Copyright (c) 1997, 1998 by Wayne E. Conrad, All Rights Reserved
Last Updated May 6, 1998
This page has been accidentally visited times since May 1st, 1998.
HTML DTD Validated Best Viewed With Any Browser

This page hosted by Get your own Free Home Page