|
|
@@ -123,13 +123,12 @@ public class BetterAutoGrowPanel<C extends Component & BetterAutoGrowPanel.Child
|
|
|
this.models = models;
|
|
|
this.callback = callback;
|
|
|
|
|
|
- final List<ChildComponent> shim = this.members.subList(0, lastIndex());
|
|
|
- shim.clear();
|
|
|
+ this.members.subList(0, lastIndex()).clear();
|
|
|
models.forEach(model -> {
|
|
|
final C comp = this.grow.makeComponent.apply(model);
|
|
|
comp.addGrowShrinkListener(new ShrinkOnEmpty(comp));
|
|
|
- shim.add(comp);
|
|
|
- add(comp);
|
|
|
+ add(comp, lastIndex());
|
|
|
+ this.members.add(lastIndex(), comp);
|
|
|
});
|
|
|
}
|
|
|
|