O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

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

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 ...

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