implemented javax.swing.BoxLayout

graydon hoare graydon@redhat.com
Mon Jul 26 11:16:00 GMT 2004


On Sat, 24 Jul 2004 03:04:39 +0200, Roman Kennke <roman@ontographics.com> wrote:

> I saw that the current BoxLayout implementation only wraps a GridLayout.
> I have fixed that, so that it now does layout computation on its own and
> works as it should.
>
> This improves the appearance of JMenuBars and disturbs the appearance of
> some dialogs (I think they relied on the GridLayout behaviour and now
> have to be slightly adjusted).
>
> Please review it and check it in, if you find it ok.

a few comments:

   - each subcomponent should only have one preferred/maximum/minimum size
     call during calculations, not one for height and another for width.

   - you missed the LINE_AXIS case in getPreferredSize()

   - the LINE_AXIS and PAGE_AXIS directions are supposed to be interpreted
     relative to the current component orientation (LINE may be vertical for
     vertically-laid-out text, for example).

I've fixed these, though, and am checking the attached, revised patch in.
thanks!

-graydon



More information about the Java-patches mailing list