Ken T. wrote:
On Wed, 29 Jul 2009 16:19:11 -0700, Roedy Green wrote:
On 29 Jul 2009 23:09:33 GMT, "Ken T." <nowhere@home.com> wrote, quoted
or indirectly quoted someone who said :
I've never written a layout manager before. Would it be relatively easy
to implement my own layout manager to handle this?
see http://mindprod.com/jgloss/layoutmanager.html
It is pretty easy to write. In this case, your layout is unlike
anything anyone else would likely want to do, so I think writing your
own is the best way out. I don't see how you could decompose it in
panels.
I'm working on this now, but I'm not sure how to do it. I really need to
know the size of the container being laid out to lay out the components
correctly. I can't seem to find that unless it is simply set in the
layout manager as in your example. I tried doing the calculation in
getPreferredSize, but it is not called before actually laying out
components. So how does the layout manager know how much real estate it
has to work with?
Thank you, and your example is a big help.
manager to *define* the preferred size.
manager to calculate the preferred size, and set the size accordingly.
Then, the layout manager knows how much space it has to work with.