Why isn't this int incrementing?
问题 I am stuck on probably an easy problem, but I really can't find why it isn't working. I am trying to increase mijnScore with 1 each time the method gets called. But somehow mijnScore goes back to 0 after the method is done. int mijnScore = 0; ... public void updateUI() { System.out.println("updateUI"); SwingUtilities.invokeLater(new Runnable() { public void run() { ikWin = true; while(ikWin) { mijnScore++; System.out.println("mijnScore" + mijnScore); Scoresp1.setText(mijnScore + ""); ikWin =