I want to count the number of times the button is clicked using GUI.
I did this code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent
Change
int clicked = 0;
to be a member of your class. This way it wont be set to zero every time you press the button.