How can I restrict the size of a component in a BoxLayout?
You can manage the sizes in two ways:
- Subclass your components and override their sizing methods:
- Drop the components inside a decorator that will manage the sizes.
I've created a set of beans that can help work with BoxLayout. See http://javadude.com/tools for "BoxBeans". In particular, the BoxAdapter bean decorates any component and provides four properties to control the maximum and minimum sizes of the contained components.