> [snip useful example program, although examples that use a JFrame are
> easier to run than examples that use a JApplet]
Sorry... I will do better next time !
> That is what BoxLayout does. It distributes extra space to its
> components in the direction that the components are laidout up to the
> maximum size of each component it that direction. Each of the two
> components in the box has the default maximum height of Short.MAX_VALUE.
Strange... I did not understood it that way before.... When I put a
BoxLayout container, followed by a vertical glue, in another BoxLayout
container, the extra space is not distributed.
It is a special behavior between BoxLayout and Gridlayout ?
> If you want the container using GridLayout to not get any extra space,
> instead of using BoxLayout for the ContentPane of the JApplet use
> BorderLayout and add the container with the grid to the ContentPane
> with a layout constraint of BorderLayout.NORTH.
Thanks. It works nice now.

Signature
Florence Henry
florence point henry arobasse obspm point fr
A. Bolmarcich - 26 Jan 2005 16:04 GMT
> Strange... I did not understood it that way before.... When I put a
> BoxLayout container, followed by a vertical glue, in another BoxLayout
> container, the extra space is not distributed.
>
> It is a special behavior between BoxLayout and Gridlayout ?
It is a difference in the maximum sizes of containers using BoxLayout
and GridLayout. The maximum size of a container using BoxLayout is the
same as the preferred size of the container (the value is returned by
the maximumLayoutSize() method of BoxLayout). The maximum size of a
container using GridLayout is Dimension(Short.MAX_VALUE,Short.MAX_VALUE)
(the value is returned by the getMaximumSize() method of
java.awt.Component).
When an enclosing container uses BoxLayout, the size of each component
may be increased up to the component's maximum size in the box layout
direction. An enclosed container that uses BoxLayout as its
layout manager will not have its size increased because its maximum
size is the same as its preferred size. An enclosed container that
uses GridLayout will have its size increased up to Short.MAX_VALUE.
Florence HENRY - 27 Jan 2005 18:20 GMT
> It is a difference in the maximum sizes of containers using BoxLayout
> and GridLayout. The maximum size of a container using BoxLayout is the
[quoted text clipped - 10 lines]
> size is the same as its preferred size. An enclosed container that
> uses GridLayout will have its size increased up to Short.MAX_VALUE.
Thanks ! I understand better now.

Signature
Florence Henry
florence point henry arobasse obspm point fr