O'Reilly logo

JavaBeans Unleashed by Rick Leinecker, Dr. Donald Doherty

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

Transforming an Applet into a Bean

Now you've gone over the design patterns you follow to create a bean, but what about all of those applets that you already wrote? Do you need to throw all of that work out and start all over to create beans? No! Java provides support for converting all of those Java applets into JavaBeans-compatible components. In this section, you convert a Java applet into a bean. Once you're finished you can convert all of your applets into beans.

You will convert a Java applet named LogoApplet (see Listing 4.1). LogoApplet displays business or company logos. In this case, it displays the Sams logo found in the samslogo.jpg file.

Listing 4.1 Source Code for LogoApplet.java
 package sams.applet; import java.awt.Graphics; ...

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