Maybe Swing is screwed enough that one can not write a
proper layout manager, but it still seems worthwhile to
try to write a nice BoxLayout. Box layouts are so much
easier to write and change (compared to grid layouts),
and properly implemented they can cover >90% of all
layout problems (based on my experience with Qt).
Required features:
- weights on all components added (defaulting to zero)
- springs and spacings to get distances
- an easy way to nest layouts (i.e. there should be a
default panel available)
- some default spacing set on the layout itself
- maybe extra features to override the min/max/pref
sizes (depends how bad the components are)
- proper calculation of the final min/max/pref sizes
for the layout
This needs constraints and we thus have to implement
java.awt.LayoutManager2 to get it. Getting the
constraint objects, the defaults and the integration in
a panel right will be crucial to the usability.