Essentially, I need help writing an increment and decrement code in my lab. I've managed to do the stuff beforehand, but I want to wrap my mind around what I'm doing with this. My first thought is creating some kind of for loop? Any ideas of how to go about this?
class IncreaseCount implements ActionListener {
public void actionPerformed(ActionEvent e) {
int counter=0;
counter++;
label.setText(String.valueOf(counter));
}
}
class DecreaseCount implements ActionListener {
public void actionPerformed(ActionEvent e) {
int counter = 0;
counter--;
label.setText(String.valueOf(counter));
}
}