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

java.awt.ScrollPane

If you've had to manually implement scrolling with the previous versions of the AWT, you'll surely appreciate the java.awt.ScrollPane class, which made its debut in the 1.1 release of the AWT.

java.awt.ScrollPane is a container, although it differs from other AWT containers in two ways:

  • Its layout manager is null and cannot be set.

  • It can only contain only one component at a time.

ScrollPane has a null layout manager;[4] its peer controls the placement of the scrollbars and the viewport. As a result, ScrollPane does not allow its layout manager to be set. ScrollPane.setLayout(), which is implemented as final so that it cannot be overridden in extensions, throws an exception if invoked.

[4] Containers have null layout managers ...

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