I call a JFrame by passing my variable as a parameter and there I assign it to another variable that I declare in order to do the necessary operations. But when I close JFrame 2 my JFrame 1 variable gets the same values.
How can this happen if I do not return anything?
// Aqui utilizo o método get do recipesTableModel para obter minha variável (Ingredient.class)
ViewDatasheetJFrame frame2 = new ViewDatasheetJFrame(recipesTModel.get(row));
frame2.setLocationRelativeTo(rootPane);
frame2.setVisible(true);