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

Canvases and Panels

The aptly named canvas provides a surface upon which you can perform graphical operations. A panel is essentially the same as a canvas, except that a panel, unlike a canvas, is also a container that can contain other components. Neither Canvas nor Panel, by default, is interested in accepting keyboard focus, and therefore do not fire key or focus events.

Until the advent of lightweight components in the 1.1 release of the AWT, Canvas and Panel were the components of choice to extend when developing custom components.[6] For custom components that did not contain other components, such as an image button, Canvas was the logical choice for the component's superclass. On the other hand, a custom component that needed to contain ...

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