I seem to be getting confused with how Containers calculate their height compared to the components in the container.
I have a Container with a TableLayout that has 1 row and 2 columns. In both cells there are different TextAreas.
TableLayout tl = new TableLayout(1, 2);
Container container = new Container(tl);
TextArea ta1 = new TextArea("Some long text");
TextArea ta2 = new TextArea("Some other long text");
container.add(tl.createConstraint().widthPercentage(50), ta1);
container.add(tl.createConstraint().widthPercentage(50), ta2);
The problem I am having is that the height of container is about double the height of the two TextAreas which leaves a big, unneeded, gap under the TextAreas.
I have tried overriding the calcPreferredSize method which seems to work with any Dimension I put in. The issue is I don't know what the height of the two TextAreas will be.
What am I doing wrong?
Thanks.