Label.setEnabled(true);
if (i == 0) {
Label.setEnabled(false);
}
If i
is equal to 0, it would not be enabled but when I close the program and open it again, it will be enabled instead of staying disabled.
Label.setEnabled(true);
if (i == 0) {
Label.setEnabled(false);
}
If i
is equal to 0, it would not be enabled but when I close the program and open it again, it will be enabled instead of staying disabled.
You need to write the current state of the program to a File. See How do I create a file and write to it in Java? on how to do that. Then, when you run the program, it needs to read from that file. You can do that like this:
File f = new File("PATH TO YOUR FILE");
try {
Scanner s = new Scanner(f);
String line1 = s.nextLine();
String line2 = s.nextLine();
//...
catch (IOException e){}