If i click my "Run" button on my GUI after changing the value of a textfield, the variable won't update.
I have the button in one class:
public void actionPerformed(ActionEvent e) {
RunSimulation r = new RunSimulation();
System.out.println(Data.campusSize);
System.out.println("Button clicked!");
}
});
and in another class, i have all my Data collected:
public class Data {
static int campusSize = Integer.valueOf(View.campusSizeTextField.getText());
}
in the RunSimulation class, the class variables in Data are accessed. If I print out Data.campusSize, it will always give the same value, even if I change it in the textField.