Container c = new Container();
c.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
c.setScrollableY(true);c.add(new Label("B");
c.add(new Label("C");
Container c = new Container(BoxLayout.y());
c.setScrollableY(true);
Container wrapper = BorderLayout.south(c);Container c = new Container(BoxLayout.y());
c.setScrollableY(true);
TableLayout tl = new TableLayout(2, 1);Constraint constraint = tl.createConstraint();constraint.setHeightPercentage(60); Container wrapper = new Container(tl);wrapper.add(constraint, new Label(" ")).add(BorderLayout.south(c)); // Label is a placeholder to occupy the top 60% and leave the remaining 40% for your c container and its shell
Hi,Is that an assumption or you've tried it and it doesn't work for you?
From the explanation of what you are trying to achieve, the first component appears at the bottom...a new one pushes it up a little... and a newer one pushes the new one up...continuously until the first element "65" reaches the top and c container becomes scrollable
.
class MyContainerTop extends Container {
MyContainerTop(Layout s) {
super(s);
}
@Override
public Dimension calcPreferredSize() {
int h = Display.getInstance().convertToPixels(SIZE, false);
Dimension d = super.calcPreferredSize();
d.setHeight(h);
return d;
}
} static final int SIZE = 25; // DIPS ~ 1mm/dip
/**
* sets size of container at top of screen
*/
/**
* sets size of container at bottom of screen
*/
class MyContainerBottom extends Container {
MyContainerBottom(Layout s) {
super(s);
}
@Override
public Dimension calcPreferredSize() {
int h = MyForm.this.getHeight() - Display.getInstance().convertToPixels(SIZE, false);
h -= MyForm.this.getToolbar().getPreferredH();
Dimension d = super.calcPreferredSize();
d.setHeight(h);
return d;
}
} result = new MyContainerTop(new BoxLayout(BoxLayout.Y_AXIS));
result.setScrollableY(true);
result.setUIID("BorderContainer"); form.add(result);
form.add(bottom_container); int h = 100 * Display.getInstance().convertToPixels(SIZE, false) / MyForm.this.getHeight();
add(layout.createConstraint().heightPercentage(h), result);
add(layout.createConstraint().heightPercentage(100-h), f);