I want my program to do something different if the button has been pressed the second or third time. For that I tried to count the clicks which worked just fine(thanks to this forum) but now I fail to test if the number is e.g 1. The error message says it is an invalid operator but what could I do else?
LongAdder numButtonClicks= new LongAdder();
tellingIntroButton.addActionListener(e -> {
numButtonClicks.increment();
if(numButtonClicks == 0) {
//some code
}
Aucun commentaire:
Enregistrer un commentaire