I have a Table and I fill it with objects from an ArrayList I want to know how I can modify the data that was already saved in the ArrayList and that the table presents them
I have a Table and I fill it with objects from an ArrayList I want to know how I can modify the data that was already saved in the ArrayList and that the table presents them
You can go through the ArrayList and update the information of any element you want.
With a List Any
ArrayList<SomeClass> someList = new ArrayList<SomeClass>();
The list is searched for an element that meets the id of the object to be modified
for (int x=0; x< someList(); x++) {
item = someList.get(x); // Obtener el elemento en un indice
if ( item.get_id_attribute == id ){ // Si el id es del objeto buscado
item.set_attribute = "value" // Actualizar un atributo usando un metodo accesos para modificar la información
}
}