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

Creating an Image Button Bean

The Picture bean is useful, but, with some additional modifications, you can make it even more useful. You can turn it into an image button bean. Image buttons are popular components in toolbars where there's usually no room for text to be displayed. In this section, you modify the Picture bean code to transform it into code for an image button bean named PictureButton.

Picture Bean as Button

You might be surprised by the amount of "button" functionality already in the Picture bean. The Picture bean is derived from Java's Canvas class, which is derived from the Component class. The Component class, which is part of the java.awt package, already contains most of the event handling mechanisms used by graphic user interface ...

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