No....usually you would use arithmetic expressions that involve the current size of the frame.
You want the spaces in your design to expand or shrink in proportion to the size of the frame. A fixed-sized component (by definition) is inflexible. The current size of the frame is determined using:
Dimension getSize()
Then access the height
and width
fields of
the Dimension
object.
This can be awkward and is usually not needed.
Another invisible component that class Box
creates
is a glue component.
Glue is thought of as stretchy caulking between components.
It keeps them separated, but expands or shrinks if needed.
To create glue use one of the following:
Box.createHorizontalGlue() Box.createVerticalGlue()