I have to do a project for college and in it I have a menu of settings, which is in a class separated from the main one, but when I try to "save" such configurations the main class does not see the change and gets the original value . I tried to do with Gets and Sets.
I did an example to try to explain
This is the first class in inte is an integer and global variable
JOptionPane.showMessageDialog(null, inte);
setInte(10);
JOptionPane.showMessageDialog(null, inte);
new dois().setVisible(true);
And here is the second class where I try to capture the value
um teste = new um ();
JOptionPane.showMessageDialog(null, teste.getInte());
In the output of the second class it left as 0.
Any suggestions? Thanks!