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
Try below code
int clicked = 0; private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { clicked++; System.out.println(clicked); }