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

Null Layout Managers

Upon hearing of layout managers, newcomers to the AWT often have an overwhelming compulsion to simply set their container's layout manager to null and explicitly position and size the components displayed in their container.

Almost without exception, such a strategy is ill-fated. A container with a null layout manager will not be able to cope with resize events. As soon as this discovery is made, the next step is to override paint() to reposition and reshape the components laid out in the container. Once things have degenerated to this point, all of the benefits of the strategy pattern[14] go down the tubes. The algorithm for laying out components becomes hardcoded in the container, and therefore the container cannot easily ...

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