[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [albireo-dev] A small fix to address layout issues

Bruno Haible wrote:

I've changed the code to get min/max/preferred values from the parent
JApplet which seems to provide more sensible values.

That achieves the goal of getting [MAXINT, MAXINT] instead of [0, MAXINT] as result. But since layout results are computed bottom-up, I find it a bit surprising to get the size from the parent. It does work, but probably only because the parent uses a BorderLayout. I find it safer to follow the bottom-up direction, by using the maximum size of the content pane. Like the attached. (Hope you don't mind.) I have checked that this commit does not change the actual values returned.

It seems to me that if we want the size constraints of the entire component, then we should be asking the top component. Asking the content pane is neither top-down nor bottom-up since it is in the middle of the component hierarchy.