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

LayoutManagers

LayoutManager is an interface that defines the following methods:

void        addLayoutComponent     (String name, Component comp)
void        removeLayoutComponent  (String name, Component comp)
Dimension   preferredLayoutSize    (Container parent)
Dimension   minimumLayoutSize      (Container parent)
void        LayoutContainer        (Container parent)

Layout managers are responsible for:

  • Calculating the preferred and minimum sizes for a container

  • Laying out the components contained in a container

It's important to note that while each container has exactly one layout manager, a single layout manager may wind up working for more than one container. Therefore, when a layout manager has to perform some work for a container, it must be passed a reference to the container ...

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