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

Transferring Custom AWT Components

Our final example, at the risk of beating data transfer to death, is to implement a transferable that encapsulates a custom component.

Note: A there is a bug under the 1.2 release of the AWT that causes the following applet to throw an exception under Windows NT (it works fine under Solaris).

A Transferable for Encapsulating a Custom Component

Our custom component will be a very simplistic image button, whose implementation we won't bother to discuss. Instead, we will simply show the implementation of ImageButtonSelection and the applet that exercises it. The complete implementation of ImageButtonSelection is listed in Example 20-5.

Example 20-5. ImageButtonSelection Class Listing
 import java.awt.*; import ...

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