An Applet Overview
An applet is a special type of Java GUI program that is intended to be run inside a Web browser. Unlike the programs shown in Chapter 8, "GUI Programming I: Applications," an applet cannot run by itself but must be hosted by another program.
Note
You can code an applet class that can run in a standalone fashion as an application and as an applet hosted by a browser. This is unusual but can easily be accomplished. To do this, you code all the applet methods that are appropriate. Then you code a main method that one way or another instantiates a Frame, instantiates the applet subclass, adds the applet object to the Frame, and then calls the applet methods as appropriate. Because the applet is running as a standalone application, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access