> I still can't figure out what setSize() is for though; the layout
> manager seems to stomp on the settings at the first possible
> opportunity anyway. Where and when is it safe to setSize()?
The layout managers do not stomp on the settings, they are supposed to
do the settings (size and position), so you don't have to. As a
cortesty, some of them take the preferred size into account.
The layout managers uses the same Component interface than you would. In
order to set the size, the layout manager badly needs the setSize()
method, same as you would need it, if you do the setting. So either you
do the setting (not recommended) or the layout manager does the
calculation and setting. But both doing the setting can't work, and is
not supposed to work. The last one wins.
I would suggest you study one of the simple layout managers, e.g.
FlowLayout. The source code comes with every JDK/SDK from Sun in a file
called src.zip or src.jar (older JDKs). It is only a few lines of simple
source code, excluding comments.
/Thomas