I want to implement a "back" button and for that, before I enter any function I copy the data from the main list in my temporary list. When the user clicks on the "back" button I call the tempList instead of the mainList.
But although I initialized the tempList(just once) with the old value of the mainList, after the function the tempList has the new values of the mainList....
Code:
ObservableList<List<String>> fnlData;
List<List<String>> fnlDataTMP;
.
.
private void cnvrtColumn() {
fnlDataTMP = fnlData;
delWV();//if the mainList(fnlData) has a change in any of this functions, the tmpList also updates the values
delWM();
addVN();
addWV();
addWM();
dateFormat();
changeChar();
finalTable.getSelectionModel().clearSelection();
finalTable.getItems().clear();
finalTable.getColumns().clear();
createColumns();
finalTable.getItems().addAll(fnlData);
}