When a figure contains children, its layout manager is responsible for setting the bounds and location of each child. There is no implicit layout manager, so if no manager is provided, then the children are not displayed. Layout managers may use the preferred size of the figure as well as a constraint to position and size the children.
Constraints are extra data that the
LayoutManager may require when positioning the children. For example, the
XYLayout (see Section 5.3.7 on page 63) takes a
Rectangle as its constraint which provides the location and size for the figure.
XYLayout layout = new XYLayout();root.setLayoutManager(layout);root.add(figures);layout.setConstraint(figures, new Rectangle(10, ...