BoxLayout fillers in Java2
There are three kinds of fillers:
- A strut adds some space between components: b.add ( button1 ); b.add ( Box.createHorizontalStrut ( 8 )); b.add ( button2 );adds 8 pixels between these buttons in a horizontal box.
- A rigid area also adds a fixed amount of space between components, but may also specify a second dimension which may affect the height of a horizontal box and the width of a vertical box. b.add ( Box.createRigidArea ( new Dimension ( 10, 20 ));
- Adding glue separates the components as much as possible. b.add ( button1 ); b.add ( Box.createGlue ( )); b.add ( button2 );