20.1. Introduction

[Note: This chapter and its exercises are intentionally small and simple for readers who wish to learn about applets after reading only the first few chapters of the book—possibly just Chapters 2 and 3. We present more complex applets in Chapter 21, Multimedia: Applets and Applications, Chapter 23, Multithreading and Chapter 24, Networking.]

This chapter introduces applets—Java programs that can be embedded in HyperText Markup Language (HTML) documents (i.e., web pages). When a browser loads a web page containing an applet, the applet downloads into the web browser and executes.

The browser that executes an applet is known as the applet container. The JDK includes the appletviewer applet container for testing applets as you ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.