Working with Box.Filler: Glue and Strut : Box « Swing « Java Tutorial






Box.Filler creates invisible components for better component positioning.

Creating Areas that Grow

public static Component createGlue()
// Direction independent
Component glue = Box.createGlue();
aBox.add(glue);

public static Component createHorizontalGlue();
// Direction dependent: horizontal
Component horizontalGlue = Box.createHorizontalGlue();
aBox.add(horizontalGlue);

public static Component createVerticalGlue()
// Direction dependent: vertical
Component verticalGlue = Box.createVerticalGlue();
aBox.add(verticalGlue);








14.88.Box
14.88.1.Box simplifies working with BoxLayoutBox simplifies working with BoxLayout
14.88.2.new Box(BoxLayout.Y_AXIS)
14.88.3.Working with Box.Filler: Glue and Strut
14.88.4.Creating Rigid Areas: StrutCreating Rigid Areas: Strut
14.88.5.Box.createVerticalGlue()Box.createVerticalGlue()