How to i update a component using addComponent in LWUIT?

54 Views Asked by At

I am trying to update a existing component in this below code snippet, where "index" is index of existing component.

    TextField l = new TextField();
    l.setText(txt);
    t.addComponent(index, l);

From the above, new component is being added at the end instead of updating to that indexed component. How we can achieve updating the existing component ?

1

There are 1 best solutions below

0
Shai Almog On

Remove the old component then add the new component or use Container.replace().