Differences Between Applets and Applications

Applets provide built-in support for obtaining images, namely, the Applet.getImage method. A Java application, however, does not extend Applet, so applications that incorporate images are implemented differently than their applet counterparts. Figure 5-2 shows an application that displays an image. The application is listed in Example 5-3.

Figure 5-2. An Application That Displays an Image

Example 5-3. ImageTestApplication
 import java.awt.*; import java.awt.event.*; public class ImageTestApplication extends ...

Get Graphic Java™ 1.2, Volume I: AWT, Third 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.