O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an Applet

There was a time when you could assume that if someone knew Java they also knew how to write an applet. With Java's growing popularity and the diminished use of applets, however, that assumption is no longer valid.

An applet is an AWT component (actually an AWT container—it can contain other graphical objects). Specifically, an applet must be a subclass of java.applet.Applet, which is a subclass of java.awt.Panel.

Note

If you're into Swing, you can use the JApplet class to implement a Swing-based applet. Keep in mind, however, that Swing doesn't work well under Internet Explorer—and because IE doesn't come with the Swing classes built-in, the browser must download them from your Web server.

Every applet is an AWT object. Specifically, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required