Java Reference
In-Depth Information
CHAPTER
14
Applets
In this chapter, I will discuss the details of writing and viewing applets. You
will find that writing an applet is similar to creating a graphical user interface
(GUI) program, especially because an applet is a container object. Containers,
components, layout managers, and event handling are a big part of develop-
ing applets. I will also cover some basic HTML concepts because applets are
embedded inside HTML documents.
An Overview of Applets
An applet is a Java program that runs in a Web browser. The term applet is
derived from application, as if to imply that an applet is a small application.
This does not need to be the case, however. An applet can be a fully functional
Java application because it has the entire Java API at its disposal.
There are some important differences between an applet and a standalone
Java application, including the following:
An applet is a Java class that extends the java.applet.Applet class.
■■
A main() method is not invoked on an applet, and an applet class will
(typically) not define main().
■■
457
Search WWH ::




Custom Search