Test case:
TableLayout tl = new TableLayout(1, 2);
Form hi = new Form("Replace Test Case", tl);
Label labelA = new Label("A");
Label labelB = new Label("B");
Label labelC = new Label("C");
hi.add(tl.createConstraint().widthPercentage(85), labelA);
hi.add(tl.createConstraint().widthPercentage(15), labelB);
hi.addShowListener(l -> {
hi.replace(labelA, labelC, CommonTransitions.createFade(2000));
});
hi.show();
Current wrong result:

The same wrong result is produced by:
TableLayout tl = new TableLayout(1, 2);
Form hi = new Form("Replace Test Case", tl);
Label labelA = new Label("A");
Label labelB = new Label("B");
Label labelC = new Label("C");
hi.add(tl.createConstraint().widthPercentage(85), labelA);
hi.add(tl.createConstraint().widthPercentage(15), labelB);
hi.addShowListener(l -> {
int index = hi.getComponentIndex(labelA);
labelA.remove();
hi.add(index, labelC);
hi.revalidateWithAnimationSafety();
});
hi.show();
The correct expected result in both cases should be:

Test case:
Current wrong result:
The same wrong result is produced by:
The correct expected result in both cases should be: